Integrate Buy Box warnings in Grid tab; fix prop regression in App.tsx

This commit is contained in:
Christian Vidal Wolf
2026-01-29 13:45:41 +01:00
parent fa14f57855
commit fcc8096b01
2 changed files with 5 additions and 1 deletions
+1
View File
@@ -690,6 +690,7 @@ const App: React.FC = () => {
vendorStockMap={vendorStockMap}
top50Ranking={top50Ranking2025}
top50Mode={filters.customer.includes('Amazon UK') ? 'uk' : 'eu'}
buyBoxLostMap={buyBoxLostMap}
/>
</div>
</Suspense>
+4 -1
View File
@@ -8,6 +8,7 @@ import { DownloadIcon, FunnelIcon, CloseIcon, ChartIcon, TrendingIcon } from './
import { StockBadge } from './StockBadge';
import { Top50Badge } from './Top50Badge';
import { VendorStockBadge } from './VendorStockBadge';
import { BuyBoxWarningBadge } from './BuyBoxWarningBadge';
interface DataGridProps {
data: SalesRecord[] | CombinedKPIs[];
@@ -20,6 +21,7 @@ interface DataGridProps {
};
top50Mode: 'eu' | 'uk';
vendorStockMap?: Map<string, { eu: number; uk: number }>;
buyBoxLostMap?: Map<string, { countries: string[]; reasons: Record<string, string> }>;
}
type SortConfig = {
@@ -236,7 +238,7 @@ const ExpandableChartCard: React.FC<{ title: string; children: React.ReactNode;
};
const DataGrid: React.FC<DataGridProps> = ({ data, hasCustomerFilter, adsData, stockMap, vendorStockMap, top50Ranking, top50Mode }) => {
const DataGrid: React.FC<DataGridProps> = ({ data, hasCustomerFilter, adsData, stockMap, vendorStockMap, top50Ranking, top50Mode, buyBoxLostMap }) => {
const [currentPage, setCurrentPage] = useState(1);
const [sortConfig, setSortConfig] = useState<SortConfig>({ key: null, direction: 'desc' });
const [showChart, setShowChart] = useState(true);
@@ -1114,6 +1116,7 @@ const DataGrid: React.FC<DataGridProps> = ({ data, hasCustomerFilter, adsData, s
return null;
})()}
<span>{(row[dim as keyof PivotRow] as string) || '-'}</span>
<BuyBoxWarningBadge asin={row.asin} buyBoxLostMap={buyBoxLostMap} />
</div>
: (row[dim as keyof PivotRow] as string) || '-'
}