// Products page — všechny produkty na jedné stránce s filtračními pilulkami // (filtr na místě, bez načítání). Dropdown deep-linkuje konkrétní kategorii. (function () { if (typeof React === "undefined") return; const Icon = window.VNIcon; const FILTERS = [ { id: "vse", label: "Vše" }, { id: "carnica", label: "Kraňka" }, { id: "buckfast", label: "Buckfast" }, { id: "inseminace", label: "Inseminované" }, { id: "oddelky", label: "Oddělky a včelstva" }, ]; const matchFilter = (p, f) => f === "vse" ? true : p.cat === f; function Products({ go, catId, addToCart, onQuickView, onNotify, onPreorder }) { const D = window.SHOP_DATA; const norm = (id) => (!id || id === "all") ? "vse" : (FILTERS.some((f) => f.id === id) ? id : "vse"); const [filter, setFilter] = React.useState(norm(catId)); const [loading, setLoading] = React.useState(true); const [fading, setFading] = React.useState(false); // initial skeleton (once) React.useEffect(() => { const t = setTimeout(() => setLoading(false), 500); return () => clearTimeout(t); }, []); // deep-link: sync the active filter when the nav passes a category React.useEffect(() => { setFilter(norm(catId)); }, [catId]); const counts = React.useMemo(() => { const c = {}; FILTERS.forEach((f) => { c[f.id] = D.products.filter((p) => matchFilter(p, f.id)).length; }); return c; }, []); const items = D.products.filter((p) => matchFilter(p, filter)).sort((a, b) => b.reviews - a.reviews); const pick = (id) => { if (id === filter) return; setFading(true); setTimeout(() => { setFilter(id); setFading(false); }, 160); }; const gridStyle = { opacity: fading ? 0 : 1, transform: fading ? "translateY(8px)" : "none", transition: "opacity 160ms ease, transform 160ms ease", paddingBottom: "var(--section-y)", }; return (

Naše nabídka

Kraňské a buckfast matky, inseminovaný chovný materiál, oddělky a včelstva — všechno na jednom místě. Sezónní nabídka, omezený počet kusů.

{FILTERS.map((f) => ( ))}
{loading && [0,1,2,3,4,5].map((i) => (
); } window.VNCategory = Products; })();