From e8e7261409850ce1b3ab1f0a29e57dedb2edef95 Mon Sep 17 00:00:00 2001 From: Kelly Date: Wed, 17 Dec 2025 02:33:07 -0700 Subject: [PATCH] fix: TypeScript null check in StockStatusBadge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use != null to handle both null and undefined for optional daysUntilOOS prop 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- cannaiq/src/components/StockStatusBadge.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cannaiq/src/components/StockStatusBadge.tsx b/cannaiq/src/components/StockStatusBadge.tsx index ea29762f..f62bd008 100644 --- a/cannaiq/src/components/StockStatusBadge.tsx +++ b/cannaiq/src/components/StockStatusBadge.tsx @@ -38,10 +38,10 @@ export function StockStatusBadge({ if (!inStock) { bgColor = 'bg-red-600'; label = 'Out of Stock'; - } else if (daysUntilOOS !== null && daysUntilOOS <= 3) { + } else if (daysUntilOOS != null && daysUntilOOS <= 3) { bgColor = 'bg-orange-600'; label = `Low (${daysUntilOOS}d)`; - } else if (daysUntilOOS !== null && daysUntilOOS <= 7) { + } else if (daysUntilOOS != null && daysUntilOOS <= 7) { bgColor = 'bg-yellow-600'; textColor = 'text-black'; label = `Moderate (${daysUntilOOS}d)`;