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 (
LOPOBYA
{filtered.length} {t("products", "produk")}