From b01401272ca7bf057398e63e34e8275b7e0f8197 Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Mon, 27 Apr 2026 11:25:09 +0200 Subject: [PATCH] Fix: ensure Amazon stock badges are visible in Profitability and Top Movers tabs --- components/TopMovers.tsx | 2 +- components/mkt/MasterTable.tsx | 39 +++++++++++++++++++++++++++++----- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/components/TopMovers.tsx b/components/TopMovers.tsx index 4fa3e93..4071921 100644 --- a/components/TopMovers.tsx +++ b/components/TopMovers.tsx @@ -130,7 +130,7 @@ const MoversTable: React.FC<{ {/* Stock Badge */} - + {/* Vendor Stock Badge */} diff --git a/components/mkt/MasterTable.tsx b/components/mkt/MasterTable.tsx index 47422ec..a570e27 100644 --- a/components/mkt/MasterTable.tsx +++ b/components/mkt/MasterTable.tsx @@ -2,17 +2,34 @@ import React, { useState, useMemo } from 'react'; import { Product } from './types'; import { formatCurrency, formatPercent, calculateProductMetrics, cn } from './utils'; import { ArrowUpDown, AlertCircle, ChevronUp, ChevronDown } from 'lucide-react'; +import { StockBadge } from '../StockBadge'; +import { VendorStockBadge } from '../VendorStockBadge'; +import { BuyBoxWarningBadge } from '../BuyBoxWarningBadge'; interface MasterTableProps { products: Product[]; includeCOGS: boolean; onProductClick: (product: Product) => void; + stockMap?: Map; + vendorStockMap?: Map; + top50Mode?: 'eu' | 'uk'; + velocityMap?: Map; + buyBoxLostMap?: Map }>; } type SortKey = 'name' | 'grossSales' | 'ppcSpend' | 'deals' | 'promos' | 'chargebacks' | 'netMargin' | 'marginPercent'; type SortOrder = 'asc' | 'desc'; -export const MasterTable: React.FC = ({ products, includeCOGS, onProductClick }) => { +export const MasterTable: React.FC = ({ + products, + includeCOGS, + onProductClick, + stockMap, + vendorStockMap, + top50Mode = 'eu', + velocityMap, + buyBoxLostMap +}) => { const [sortKey, setSortKey] = useState('marginPercent'); const [sortOrder, setSortOrder] = useState('asc'); @@ -172,10 +189,22 @@ export const MasterTable: React.FC = ({ products, includeCOGS, className="hover:bg-[#1A1E2A] transition-colors cursor-pointer group" onClick={() => onProductClick(product)} > - -
{product.name}
-
{product.sku} | {product.asin}
- + +
{product.name}
+
{product.sku} | {product.asin}
+
+ {stockMap && ( + + )} + + +
+
{formatCurrency(product.grossSales)}