From 11ddcb16c5ce35775a864c9c77b4ebb12f359e56 Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Fri, 17 Apr 2026 12:48:18 +0200 Subject: [PATCH] fix: add fallback UI to VendorStockBadge to prevent empty WOC lines when data is missing --- components/VendorStockBadge.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/components/VendorStockBadge.tsx b/components/VendorStockBadge.tsx index a853db0..1a34486 100644 --- a/components/VendorStockBadge.tsx +++ b/components/VendorStockBadge.tsx @@ -9,10 +9,22 @@ interface VendorStockBadgeProps { } export const VendorStockBadge: React.FC = ({ asin, vendorStockMap, mode, avgWeeklySales }) => { - if (!vendorStockMap || !asin) return null; + if (!asin) return null; - const stockData = vendorStockMap.get(asin.toUpperCase()); - if (!stockData) return null; + const stockData = vendorStockMap?.get(asin.toUpperCase()); + + if (!stockData) { + return ( +
+
+ No Data +
+
+ - +
+
+ ); + } const stock = mode === 'uk' ? stockData.uk : stockData.eu;