+
-
diff --git a/dashboard/src/components/dashboard/StatCards.jsx b/dashboard/src/components/dashboard/StatCards.jsx
index fbb6345..7bd8170 100644
--- a/dashboard/src/components/dashboard/StatCards.jsx
+++ b/dashboard/src/components/dashboard/StatCards.jsx
@@ -69,6 +69,7 @@ import {
import { Skeleton } from "@/components/ui/skeleton";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
+import { Progress } from "@/components/ui/progress";
const formatCurrency = (value, minimumFractionDigits = 0) => {
if (!value || isNaN(value)) return "$0";
@@ -939,7 +940,8 @@ const StatCard = ({
onClick,
info,
onDetailsClick,
- isLoading = false
+ isLoading = false,
+ progress
}) => (
>
) : (
- <>
-
- {valuePrefix}{value}{valueSuffix}
-
- {description && (
-
- {description}
- {trend && (
-
- {trend === 'up' ? : }
- {trendPrefix}{trendValue}{trendSuffix}
-
- )}
+
+
+
+ {valuePrefix}{value}{valueSuffix}
- )}
- >
+ {description && (
+
+ {description}
+ {trend && (
+
+ {trend === 'up' ? : }
+ {trendPrefix}{trendValue}{trendSuffix}
+
+ )}
+
+ )}
+
+
+
)}
@@ -1229,6 +1234,7 @@ const StatCards = ({
setDetailDataLoading(prev => ({ ...prev, [metric]: false }));
}
}, [timeRange, startDate, endDate, shouldUseLast30Days, setCacheData, getCacheData]);
+
// Corrected preloadDetailData function
const preloadDetailData = useCallback(() => {
const metrics = [
@@ -1595,15 +1601,16 @@ const StatCards = ({
-
+
Proj: Projected: {formatCurrency(stats.projectedRevenue)}
: `Previous: ${formatCurrency(stats.prevPeriodRevenue)}`
}
+ progress={stats?.periodProgress < 100 ? stats.periodProgress : undefined}
trend={revenueTrend?.trend}
trendValue={revenueTrend?.value ? formatPercentage(revenueTrend.value) : null}
colorClass="text-green-600 dark:text-green-400"