// 彤冠茶莊 website — Shop listing const { ProductCard: SProductCard } = window.TongguanTeaDesignSystem_a1a7a1; const SHOP_CAT = { "qilai-set": "sets", "sustain-set": "sets", "qilai-oolong": "tea", "ying-light": "tea", "ying-honey": "tea", "travel-teaware": "ware", }; function ShopPage({ t, lang, products, go, addToCart }) { const [filter, setFilter] = React.useState("all"); React.useEffect(() => { if (window.lucide) window.lucide.createIcons(); }); const tabs = [["all", t.shop.all], ["sets", t.shop.sets], ["tea", t.shop.tea], ["ware", t.shop.ware]]; const list = products.filter((p) => filter === "all" || SHOP_CAT[p.id] === filter); return (
{/* header band */}
彤冠茶莊 · Shop

{t.shop.title}

{t.shop.body}

{/* filters */}
{tabs.map(([id, label]) => { const active = filter === id; return ( ); })} {list.length} 件
{list.map((p) => ( ({ label: tg[lang], tone: tg.tone }))} amount={p.price} badge={p.badge} addLabel={t.product.add} onAdd={() => addToCart(p.id)} onClick={() => go("product", p.id)} /> ))}
); } window.ShopPage = ShopPage;