import React from 'react'; interface StockBadgeProps { stock: number | undefined; } export const StockBadge: React.FC = ({ stock }) => { if (stock === undefined) return null; const isLow = stock < 50; const isOut = stock <= 0; let themeClasses = "from-indigo-600 to-purple-600 border-indigo-400/50"; let icon = "📦"; if (isOut) { themeClasses = "from-rose-600 to-red-700 border-rose-400/50"; icon = "❌"; } else if (isLow) { themeClasses = "from-amber-500 to-orange-600 border-amber-400/50"; icon = "⚠️"; } return (
{icon}
Stock {stock.toLocaleString('de-DE')}
); };