import { Icons } from './Icons'; function StockCard({ item, onAdd, disabled }: { item: any, onAdd?: () => void, disabled?: boolean }) { const hasTier1 = item.bulk1Threshold > 0 && item.bulk1Price > 0; const hasTier2 = item.bulk2Threshold > 0 && item.bulk2Price > 0; const hasLimit = item.maxStock !== null && item.maxStock !== undefined; const remaining = item.remainingStock; const stockPct = hasLimit ? Math.max(0, (remaining / item.maxStock) * 100) : 100; return (
{item.category} {hasLimit && ( {remaining}{item.unit} left )}

{item.name}

${item.price} / {item.unit}
{hasTier1 && (
Buy {item.bulk1Threshold}{item.unit}+: ${item.bulk1Price}
)} {hasTier2 && (
Buy {item.bulk2Threshold}{item.unit}+: ${item.bulk2Price}
)}

{item.description}

{hasLimit && (
)}
); } export default function CustomerView({ stock, faqs, onAddToCart, config }: { stock: any[], faqs: any[], onAddToCart: (item: any) => void, config?: any }) { const availableStock = stock.filter(item => item.available); const soldOutStock = stock.filter(item => !item.available); const formatDate = (d: string) => { if (!d) return 'TBA'; try { return new Date(d).toLocaleString('en-AU', { weekday: 'long', day: 'numeric', month: 'long', hour: '2-digit', minute: '2-digit' }); } catch (e) { return d; } }; return (

Feed the Beast

Premium smoked meats by the Kilogram.
Bulk discounts applied automatically at checkout.

Terms of Service & Ordering Policy

{config?.termsOfService || `To secure your order, a ${config?.depositPercentage || 30}% non-refundable deposit is required upfront before smoking begins. Payments can be made via PayID or Cash. The remaining balance is payable upon pickup.`}

Final Deposit Deadline

{config?.finalDepositDate ? formatDate(config.finalDepositDate) : 'TBA'}

Scheduled Cook Day

{config?.cookDay ? new Date(config.cookDay).toLocaleDateString('en-AU', { weekday: 'long', day: 'numeric', month: 'long' }) : 'TBA'}

{config?.orderingPolicy || 'Deposits cover material costs and are final. PayID details provided after ordering.'}

In The Smoker

{availableStock.map(item => ( onAddToCart(item)} /> ))} {availableStock.length === 0 &&

Nothing in the smoker right now.

}
{soldOutStock.length > 0 && (

Sold Out

{soldOutStock.map(item => ( ))}
)} {faqs && faqs.length > 0 && (

Frequently Asked Questions

{faqs.map(faq => (

{faq.question}

{faq.answer}

))}
)}
); }