Revamp analytics dashboard UI and charts
All checks were successful
Build Frontend / build (push) Successful in 1m11s
All checks were successful
Build Frontend / build (push) Successful in 1m11s
Enhanced the AnalyticsDashboard layout with a premium glassmorphism UI, improved toolbar, and reorganized tabs for better clarity. MetricsCard now features dynamic color coding and trend badges. PredictionsChart received scenario simulation UI upgrades, disabled future ranges based on available history, and improved chart tooltips and visuals. ProfitAnalyticsChart added error handling for product images and minor UI refinements. Updated globals.css with new premium utility classes and improved dark mode color variables.
This commit is contained in:
@@ -18,6 +18,7 @@ export interface ProfitOverview {
|
||||
topProfitableProducts: Array<{
|
||||
productId: string;
|
||||
productName: string;
|
||||
image?: string;
|
||||
totalQuantitySold: number;
|
||||
totalRevenue: number;
|
||||
totalCost: number;
|
||||
@@ -51,7 +52,7 @@ export const getProfitOverview = async (
|
||||
periodOrRange?: string | DateRange
|
||||
): Promise<ProfitOverview> => {
|
||||
let url = '/analytics/profit-overview';
|
||||
|
||||
|
||||
if (periodOrRange && typeof periodOrRange !== 'string') {
|
||||
// Date range provided
|
||||
const startDate = periodOrRange.from.toISOString().split('T')[0];
|
||||
@@ -62,7 +63,7 @@ export const getProfitOverview = async (
|
||||
const period = periodOrRange || '30';
|
||||
url += `?period=${period}`;
|
||||
}
|
||||
|
||||
|
||||
return apiRequest(url);
|
||||
};
|
||||
|
||||
@@ -70,7 +71,7 @@ export const getProfitTrends = async (
|
||||
periodOrRange?: string | DateRange
|
||||
): Promise<ProfitTrend[]> => {
|
||||
let url = '/analytics/profit-trends';
|
||||
|
||||
|
||||
if (periodOrRange && typeof periodOrRange !== 'string') {
|
||||
// Date range provided
|
||||
const startDate = periodOrRange.from.toISOString().split('T')[0];
|
||||
@@ -81,6 +82,6 @@ export const getProfitTrends = async (
|
||||
const period = periodOrRange || '30';
|
||||
url += `?period=${period}`;
|
||||
}
|
||||
|
||||
|
||||
return apiRequest(url);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user