/* global React */ const { Badge, Button } = window.DesignSystem_b1e064; const BOTTLE_CR = 'assets/images/cuoccio-bottle.jpg'; const TREE_CREAM_CR = 'assets/logos/cuoccio-tree-cream.png'; const TREE_LEAF_CR = 'assets/logos/cuoccio-tree-leaf.png'; const qtyBtnCr = { width: 38, height: 38, border: 'none', background: 'transparent', cursor: 'pointer', color: 'var(--text-primary)', fontSize: 20, lineHeight: 1, }; const fmtEuroCr = (n) => n.toFixed(2).replace('.', ',') + ' €'; function Cart({ cart = [], onQty, onRemove, onCheckout, onShop }) { const items = cart; const subtotal = items.reduce((s, it) => s + (it.priceNum || 0) * (it.qty || 1), 0); const shipping = items.length === 0 ? 0 : (subtotal >= 60 ? 0 : 6); const free = subtotal >= 60; return (
01 Carrello / 02 Dati / 03 Pagamento

Il tuo carrello

{items.length === 0 ? ( /* EMPTY STATE */

Il carrello è vuoto

Porta in tavola un olio genuino, frutto di una storia di famiglia e di lavoro tenace.

) : (
{/* LINE ITEMS */}
{items.map((it, i) => (
{it.label}
{fmtEuroCr(it.priceNum || 0)} / pz
{it.qty || 1}
{fmtEuroCr((it.priceNum || 0) * (it.qty || 1))}
))}
{/* SUMMARY */}
)}
); } window.Cart = Cart;