From ab79f2ca6e31aecf27413b54be3f371a9270230e Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Thu, 19 Feb 2026 16:36:05 +0100 Subject: [PATCH] feat: implement 1-to-1 metric swap (Units vs Revenue) in Weekly Sales --- components/WeeklyGrid.tsx | 71 +++++---------------------------------- 1 file changed, 8 insertions(+), 63 deletions(-) diff --git a/components/WeeklyGrid.tsx b/components/WeeklyGrid.tsx index 5caefc7..b08cb15 100644 --- a/components/WeeklyGrid.tsx +++ b/components/WeeklyGrid.tsx @@ -267,51 +267,8 @@ const WeeklyRow: React.FC<{ )}
- {/* Secondary Metrics & Ads Spend */} -
- {primaryMetric === 'units' ? ( - revenue > 0 && ( - `€${v.toLocaleString('de-DE', { minimumFractionDigits: 0, maximumFractionDigits: 0 })}`} - > -
- - €{revenue.toLocaleString('de-DE', { minimumFractionDigits: 0, maximumFractionDigits: 0 })} - - {renderGrowth(revenue, prevRevenue)} -
-
- ) - ) : ( - val > 0 && ( - -
- - {val.toLocaleString('de-DE')} - - {renderGrowth(val, prevVal)} -
-
- ) - )} - + {/* Ads Spend & GV */} +
{/* Always show Ads Spend (if > 0) */} {spend > 0 && ( = ({ {weekTotals[week]?.units.toLocaleString('de-DE') || 0} {renderGrowth(weekTotals[week]?.units || 0, weekTotals[weeks[idx + 1]]?.units || 0)}
-
-
- €{(weekTotals[week]?.revenue || 0).toLocaleString('de-DE', { minimumFractionDigits: 0, maximumFractionDigits: 0 })} - {renderGrowth(weekTotals[week]?.revenue || 0, weekTotals[weeks[idx + 1]]?.revenue || 0)} -
-
- Ads: €{(weekTotals[week]?.spend || 0).toLocaleString('de-DE', { minimumFractionDigits: 0, maximumFractionDigits: 0 })} - {renderGrowth(weekTotals[week]?.spend || 0, weekTotals[weeks[idx + 1]]?.spend || 0)} -
+
+ Ads: €{(weekTotals[week]?.spend || 0).toLocaleString('de-DE', { minimumFractionDigits: 0, maximumFractionDigits: 0 })} + {renderGrowth(weekTotals[week]?.spend || 0, weekTotals[weeks[idx + 1]]?.spend || 0)}
) : ( @@ -1025,15 +976,9 @@ const WeeklyGrid: React.FC = ({ €{(weekTotals[week]?.revenue || 0).toLocaleString('de-DE', { minimumFractionDigits: 0, maximumFractionDigits: 0 })} {renderGrowth(weekTotals[week]?.revenue || 0, weekTotals[weeks[idx + 1]]?.revenue || 0)}
-
-
- {(weekTotals[week]?.units || 0).toLocaleString('de-DE')} Units - {renderGrowth(weekTotals[week]?.units || 0, weekTotals[weeks[idx + 1]]?.units || 0)} -
-
- Ads: €{(weekTotals[week]?.spend || 0).toLocaleString('de-DE', { minimumFractionDigits: 0, maximumFractionDigits: 0 })} - {renderGrowth(weekTotals[week]?.spend || 0, weekTotals[weeks[idx + 1]]?.spend || 0)} -
+
+ Ads: €{(weekTotals[week]?.spend || 0).toLocaleString('de-DE', { minimumFractionDigits: 0, maximumFractionDigits: 0 })} + {renderGrowth(weekTotals[week]?.spend || 0, weekTotals[weeks[idx + 1]]?.spend || 0)}
)}