mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 15:35:22 +02:00
Integrate Buy Box warnings in Grid tab; fix prop regression in App.tsx
This commit is contained in:
@@ -690,6 +690,7 @@ const App: React.FC = () => {
|
|||||||
vendorStockMap={vendorStockMap}
|
vendorStockMap={vendorStockMap}
|
||||||
top50Ranking={top50Ranking2025}
|
top50Ranking={top50Ranking2025}
|
||||||
top50Mode={filters.customer.includes('Amazon UK') ? 'uk' : 'eu'}
|
top50Mode={filters.customer.includes('Amazon UK') ? 'uk' : 'eu'}
|
||||||
|
buyBoxLostMap={buyBoxLostMap}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { DownloadIcon, FunnelIcon, CloseIcon, ChartIcon, TrendingIcon } from './
|
|||||||
import { StockBadge } from './StockBadge';
|
import { StockBadge } from './StockBadge';
|
||||||
import { Top50Badge } from './Top50Badge';
|
import { Top50Badge } from './Top50Badge';
|
||||||
import { VendorStockBadge } from './VendorStockBadge';
|
import { VendorStockBadge } from './VendorStockBadge';
|
||||||
|
import { BuyBoxWarningBadge } from './BuyBoxWarningBadge';
|
||||||
|
|
||||||
interface DataGridProps {
|
interface DataGridProps {
|
||||||
data: SalesRecord[] | CombinedKPIs[];
|
data: SalesRecord[] | CombinedKPIs[];
|
||||||
@@ -20,6 +21,7 @@ interface DataGridProps {
|
|||||||
};
|
};
|
||||||
top50Mode: 'eu' | 'uk';
|
top50Mode: 'eu' | 'uk';
|
||||||
vendorStockMap?: Map<string, { eu: number; uk: number }>;
|
vendorStockMap?: Map<string, { eu: number; uk: number }>;
|
||||||
|
buyBoxLostMap?: Map<string, { countries: string[]; reasons: Record<string, string> }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
type SortConfig = {
|
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 [currentPage, setCurrentPage] = useState(1);
|
||||||
const [sortConfig, setSortConfig] = useState<SortConfig>({ key: null, direction: 'desc' });
|
const [sortConfig, setSortConfig] = useState<SortConfig>({ key: null, direction: 'desc' });
|
||||||
const [showChart, setShowChart] = useState(true);
|
const [showChart, setShowChart] = useState(true);
|
||||||
@@ -1114,6 +1116,7 @@ const DataGrid: React.FC<DataGridProps> = ({ data, hasCustomerFilter, adsData, s
|
|||||||
return null;
|
return null;
|
||||||
})()}
|
})()}
|
||||||
<span>{(row[dim as keyof PivotRow] as string) || '-'}</span>
|
<span>{(row[dim as keyof PivotRow] as string) || '-'}</span>
|
||||||
|
<BuyBoxWarningBadge asin={row.asin} buyBoxLostMap={buyBoxLostMap} />
|
||||||
</div>
|
</div>
|
||||||
: (row[dim as keyof PivotRow] as string) || '-'
|
: (row[dim as keyof PivotRow] as string) || '-'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user