From 657009a7ba22accfca9cd50bac67b375267264ce Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Thu, 12 Mar 2026 14:35:37 +0100 Subject: [PATCH] feat: wire MKT tab to top-level filters and remove internal category filter MktDataView now receives filteredData/filteredAdsData so the global FilterBar controls the tab's data. Removed the local "All Categories" dropdown that previously sat next to the Include COGS toggle. Co-Authored-By: Claude Sonnet 4.6 --- App.tsx | 2 +- components/mkt/MktDataView.tsx | 34 ++-------------------------------- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/App.tsx b/App.tsx index f3ac6f5..ba2f112 100644 --- a/App.tsx +++ b/App.tsx @@ -926,7 +926,7 @@ const App: React.FC = () => { }>
- +
diff --git a/components/mkt/MktDataView.tsx b/components/mkt/MktDataView.tsx index 9686449..993ce8e 100644 --- a/components/mkt/MktDataView.tsx +++ b/components/mkt/MktDataView.tsx @@ -5,7 +5,7 @@ import { Product } from './types'; import { KPICards } from './KPICards'; import { MasterTable } from './MasterTable'; import { WaterfallModal } from './WaterfallModal'; -import { Filter, Settings2 } from 'lucide-react'; +import { Settings2 } from 'lucide-react'; // --------------------------------------------------------------------------- // Excel parsing helpers (all files use raw: true so numbers come back as JS numbers) @@ -94,7 +94,6 @@ interface MktDataViewProps { export default function MktDataView({ rawData, adsData }: MktDataViewProps) { const [includeCOGS, setIncludeCOGS] = useState(true); - const [selectedCategory, setSelectedCategory] = useState('All'); const [selectedProduct, setSelectedProduct] = useState(null); const [mktLoading, setMktLoading] = useState(true); @@ -198,20 +197,7 @@ export default function MktDataView({ rawData, adsData }: MktDataViewProps) { })); }, [rawData, adsData, dealsMap, promosMap, chargebacksMap]); - const categories = useMemo( - () => ['All', ...Array.from(new Set(allProducts.map(p => p.category))).sort()], - [allProducts] - ); - - const filteredProducts = useMemo(() => { - if (selectedCategory === 'All') return allProducts; - return allProducts.filter(p => p.category === selectedCategory); - }, [allProducts, selectedCategory]); - - // Reset category filter when product list changes (e.g. rawData load) - useEffect(() => { - setSelectedCategory('All'); - }, [rawData]); + const filteredProducts = allProducts; // --------------------------------------------------------------------------- // Loading skeleton — shown while MKT files are being fetched or rawData is empty @@ -256,22 +242,6 @@ export default function MktDataView({ rawData, adsData }: MktDataViewProps) {
- {/* Category Filter */} -
- - -
- {/* COGS Toggle */}