diff --git a/dashboard/src/components/dashboard/MiniSalesChart.jsx b/dashboard/src/components/dashboard/MiniSalesChart.jsx
index e1b3eae..79d9b9f 100644
--- a/dashboard/src/components/dashboard/MiniSalesChart.jsx
+++ b/dashboard/src/components/dashboard/MiniSalesChart.jsx
@@ -134,6 +134,35 @@ const MiniStatCard = memo(({
MiniStatCard.displayName = "MiniStatCard";
+const SkeletonCard = ({ colorScheme = "emerald" }) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+);
+
const MiniSalesChart = ({ className = "" }) => {
const [data, setData] = useState([]);
const [loading, setLoading] = useState(true);
@@ -247,47 +276,8 @@ const MiniSalesChart = ({ className = "" }) => {
{/* Stat Cards */}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
{/* Chart Card */}
@@ -304,129 +294,175 @@ const MiniSalesChart = ({ className = "" }) => {
{/* Stat Cards */}
- = 0 ? "up" : "down"}
- trendValue={`${Math.abs(Math.round(summaryStats.growth.revenue))}%`}
- colorClass="text-emerald-300"
- titleClass="text-emerald-300 font-bold text-md"
- descriptionClass="text-emerald-300 text-md font-semibold"
- icon={PiggyBank}
- iconColor="text-emerald-900"
- iconBackground="bg-emerald-300"
- onClick={() => toggleMetric('revenue')}
- active={visibleMetrics.revenue}
- />
- = 0 ? "up" : "down"}
- trendValue={`${Math.abs(Math.round(summaryStats.growth.orders))}%`}
- colorClass="text-blue-300"
- titleClass="text-blue-300 font-bold text-md"
- descriptionClass="text-blue-300 text-md font-semibold"
- icon={Truck}
- iconColor="text-blue-900"
- iconBackground="bg-blue-300"
- onClick={() => toggleMetric('orders')}
- active={visibleMetrics.orders}
- />
+ {loading ? (
+ <>
+
+
+ >
+ ) : (
+ <>
+ = 0 ? "up" : "down"}
+ trendValue={`${Math.abs(Math.round(summaryStats.growth.revenue))}%`}
+ colorClass="text-emerald-300"
+ titleClass="text-emerald-300 font-bold text-md"
+ descriptionClass="text-emerald-300 text-md font-semibold"
+ icon={PiggyBank}
+ iconColor="text-emerald-900"
+ iconBackground="bg-emerald-300"
+ onClick={() => toggleMetric('revenue')}
+ active={visibleMetrics.revenue}
+ />
+ = 0 ? "up" : "down"}
+ trendValue={`${Math.abs(Math.round(summaryStats.growth.orders))}%`}
+ colorClass="text-blue-300"
+ titleClass="text-blue-300 font-bold text-md"
+ descriptionClass="text-blue-300 text-md font-semibold"
+ icon={Truck}
+ iconColor="text-blue-900"
+ iconBackground="bg-blue-300"
+ onClick={() => toggleMetric('orders')}
+ active={visibleMetrics.orders}
+ />
+ >
+ )}
{/* Chart Card */}
-
-
-
-
- {visibleMetrics.revenue && (
- formatCurrency(value, false)}
+ {loading ? (
+
+ {/* Grid lines */}
+ {[...Array(5)].map((_, i) => (
+
+ ))}
+ {/* Y-axis labels */}
+
+ {[...Array(5)].map((_, i) => (
+
+ ))}
+
+ {/* X-axis labels */}
+
+ {[...Array(6)].map((_, i) => (
+
+ ))}
+
+ {/* Chart lines */}
+
+
+ ) : (
+
+
+
+
- )}
- {visibleMetrics.orders && (
- formatCurrency(value, false)}
+ className="text-xs"
+ tick={{ fill: "#f5f5f4" }}
+ />
+ )}
+ {visibleMetrics.orders && (
+
+ )}
+ {
+ if (active && payload && payload.length) {
+ const timestamp = new Date(payload[0].payload.timestamp);
+ return (
+
+
+
+ {timestamp.toLocaleDateString([], {
+ weekday: "short",
+ month: "short",
+ day: "numeric"
+ })}
+
+ {payload
+ .filter(entry => visibleMetrics[entry.dataKey])
+ .map((entry, index) => (
+
+
+ {entry.name}:
+
+
+ {entry.dataKey === 'revenue'
+ ? formatCurrency(entry.value)
+ : entry.value.toLocaleString()}
+
+
+ ))}
+
+
+ );
+ }
+ return null;
+ }}
/>
- )}
- {
- if (active && payload && payload.length) {
- const timestamp = new Date(payload[0].payload.timestamp);
- return (
-
-
-
- {timestamp.toLocaleDateString([], {
- weekday: "short",
- month: "short",
- day: "numeric"
- })}
-
- {payload
- .filter(entry => visibleMetrics[entry.dataKey])
- .map((entry, index) => (
-
-
- {entry.name}:
-
-
- {entry.dataKey === 'revenue'
- ? formatCurrency(entry.value)
- : entry.value.toLocaleString()}
-
-
- ))}
-
-
- );
- }
- return null;
- }}
- />
- {visibleMetrics.revenue && (
-
- )}
- {visibleMetrics.orders && (
-
- )}
-
-
+ {visibleMetrics.revenue && (
+
+ )}
+ {visibleMetrics.orders && (
+
+ )}
+
+
+ )}