mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 12:25:22 +02:00
Integrate Buy Box warnings in Grid tab; fix prop regression in App.tsx
This commit is contained in:
@@ -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) || '-'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user