// aerOS Guest v2 — Cart screen + order confirmation/tracking. const { useState: _ct2S, useEffect: _ct2E } = React; function G2Cart({ C, t, lang, tw, cart, setCart, onBack, onPlaced, toast, onItem }) { const subtotal = cart.reduce((s, it) => s + it.unit * it.qty, 0); const serviceFee = Math.round(subtotal * 0.1); const total = subtotal + serviceFee; const [note, setNote] = _ct2S(''); const setQty = (id, q) => { if (q <= 0) setCart(c => c.filter(x => x.id !== id)); else setCart(c => c.map(x => x.id === id ? { ...x, qty: q } : x)); }; return (

{t.cart}

{cart.length === 0 ? (
{Icon.bag({ size: 32 })}
{t.cartEmpty}
{t.cartEmptyDesc}
{t.browseMenu}
) : ( <>
{cart.map(it => (
onItem && onItem(it.pid)} style={{ width: 64, flexShrink: 0, cursor: onItem ? 'pointer' : 'default' }}> x.id === it.pid) || {}).image} />
onItem && onItem(it.pid)} style={{ fontWeight: 700, fontSize: 15, color: C.ink, lineHeight: 1.2, cursor: onItem ? 'pointer' : 'default' }}>{it.name}
{(it.portionLabel || it.modLabels?.length || it.note) && (
{[it.portionLabel, ...(it.modLabels || [])].filter(Boolean).join(' · ')}{it.note ? ((it.portionLabel || it.modLabels?.length ? ' · ' : '') + '“' + it.note + '”') : ''}
)}
setQty(it.id, q)} C={C} size="sm" min={0} /> {G2THEME.money(it.unit * it.qty, tw.currency)}
))}
{t.cartNote}