diff --git a/App.tsx b/App.tsx
index cce56a0..e4a6891 100644
--- a/App.tsx
+++ b/App.tsx
@@ -132,6 +132,15 @@ const App: React.FC = () => {
});
};
+ const handleSkuDrillDown = useCallback((sku: string) => {
+ if (!sku) return;
+ setFilters(prev => ({
+ ...prev,
+ sku: [sku]
+ }));
+ setView('ads');
+ }, []);
+
// 1. Initial Load from Cache (IndexedDB) or Auto-Fetch Permanent URL
useEffect(() => {
const initApp = async () => {
@@ -491,7 +500,7 @@ const App: React.FC = () => {
)}
}>
{view === 'table' && 0} adsData={filteredAdsData} />}
- {view === 'weekly' && }
+ {view === 'weekly' && }
{view === 'movers' && }
{view === 'ads' && }
diff --git a/components/WeeklyGrid.tsx b/components/WeeklyGrid.tsx
index bea9dd9..ed63ccd 100644
--- a/components/WeeklyGrid.tsx
+++ b/components/WeeklyGrid.tsx
@@ -11,6 +11,7 @@ interface WeeklyGridProps {
eu?: Map;
uk?: Map;
};
+ 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 = ({ data, top50Ranking }) => {
+const WeeklyGrid: React.FC = ({ data, top50Ranking, onDrillDown }) => {
// Pivot data - memoized
const { rows, weeks: allWeeks } = useMemo(() => pivotWeeklySalesData(data), [data]);