feat: allow drill-down from Weekly Sales to Ads tab via SKU

- WeeklyGrid.tsx: Add onDrillDown prop and make SKU identifiers clickable
- App.tsx: Implement handleSkuDrillDown to switch view and filter by SKU
This commit is contained in:
Christian Vidal Wolf
2026-01-22 14:06:53 +01:00
parent 25756ae763
commit b23b2fba96
2 changed files with 12 additions and 2 deletions
+2 -1
View File
@@ -11,6 +11,7 @@ interface WeeklyGridProps {
eu?: Map<string, number>;
uk?: Map<string, number>;
};
onDrillDown?: (sku: string) => void;
}
type SortConfig = {
@@ -52,7 +53,7 @@ const Top50Badge: React.FC<{ rank: number; label?: string; theme?: 'amber' | 'bl
);
};
const WeeklyGrid: React.FC<WeeklyGridProps> = ({ data, top50Ranking }) => {
const WeeklyGrid: React.FC<WeeklyGridProps> = ({ data, top50Ranking, onDrillDown }) => {
// Pivot data - memoized
const { rows, weeks: allWeeks } = useMemo(() => pivotWeeklySalesData(data), [data]);