const CatalogPage = ({ setPage, setSelectedProduct, onAddToCart, lang }) => { const [activeCategory, setActiveCategory] = React.useState("all"); const [sort, setSort] = React.useState("default"); const t = (en, id) => lang === "id" ? id : en; const filtered = PRODUCTS .filter(p => activeCategory === "all" ? true : p.category === activeCategory) .sort((a, b) => { if (sort === "price-asc") return a.price - b.price; if (sort === "price-desc") return b.price - a.price; return 0; }); return (
{/* Header */}

LOPOBYA

{t("Our Collection", "Koleksi Kami")}

{/* Filter bar */}
{/* Categories */}
{CATEGORIES.map(cat => ( ))}
{/* Sort */}
{/* Product grid */}
{PRODUCTS.length === 0 ? (
{[1,2,3,4,5,6,7,8].map(i => (
))}
) : filtered.length === 0 ? (
{t("No products found.", "Produk tidak ditemukan.")}
) : (
{filtered.map(p => ( { setSelectedProduct(prod); setPage("product"); }} onAddToCart={onAddToCart} /> ))}
)}

{filtered.length} {t("products", "produk")}

); }; Object.assign(window, { CatalogPage });