diff --git a/dashboard/src/components/dashboard/AnalyticsDashboard.jsx b/dashboard/src/components/dashboard/AnalyticsDashboard.jsx index dd5bcc7..002b7be 100644 --- a/dashboard/src/components/dashboard/AnalyticsDashboard.jsx +++ b/dashboard/src/components/dashboard/AnalyticsDashboard.jsx @@ -302,7 +302,7 @@ export const AnalyticsDashboard = () => { Details - + Daily Details
diff --git a/dashboard/src/components/dashboard/SalesChart.jsx b/dashboard/src/components/dashboard/SalesChart.jsx index 1b046e9..eedbeb5 100644 --- a/dashboard/src/components/dashboard/SalesChart.jsx +++ b/dashboard/src/components/dashboard/SalesChart.jsx @@ -530,7 +530,8 @@ const SkeletonChart = () => (
@@ -540,7 +541,7 @@ const SkeletonChart = () => ( ); const SkeletonStats = () => ( -
+
{[...Array(4)].map((_, i) => ( @@ -569,10 +570,7 @@ const SkeletonTable = () => (
); -const SalesChart = ({ - timeRange = "last30days", - title = "Sales Overview", -}) => { +const SalesChart = ({ timeRange = "last30days", title = "Sales Overview" }) => { const [data, setData] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); @@ -690,9 +688,11 @@ const SalesChart = ({ Details - + - Daily Details + + Daily Details +
-
+
- Date - {metrics.orders && ( + + Date + + + {metrics.revenue && ( <> - Orders + + Revenue + {metrics.showPrevious && ( - Prev Orders + + Prev Revenue + )} )} - {metrics.revenue && ( + {metrics.orders && ( <> - Revenue + + Orders + {metrics.showPrevious && ( - Prev Revenue + + Prev Orders + )} )} {metrics.avgOrderValue && ( <> - AOV + + AOV + {metrics.showPrevious && ( - Prev AOV + + Prev AOV + )} )} {metrics.movingAverage && ( - 7-Day Avg + + 7-Day Avg + )} {data.map((day) => ( - {formatXAxis(day.timestamp)} - {metrics.orders && ( - <> - - {day.orders.toLocaleString()} - - {metrics.showPrevious && ( - - {day.prevOrders.toLocaleString()} - - )} - - )} + + {formatXAxis(day.timestamp)} + + {metrics.revenue && ( <> @@ -823,6 +835,18 @@ const SalesChart = ({ )} + )} + {metrics.orders && ( + <> + + {day.orders.toLocaleString()} + + {metrics.showPrevious && ( + + {day.prevOrders.toLocaleString()} + + )} + )} {metrics.avgOrderValue && ( <> @@ -869,7 +893,12 @@ const SalesChart = ({ {/* Show stats only if not in error state */} - {!error && (loading ? : )} + {!error && + (loading ? ( + + ) : ( + + ))} {/* Show metric toggles only if not in error state */} {!error && ( @@ -925,8 +954,14 @@ const SalesChart = ({ - - + +