import{j as e}from"./jsx-runtime.D_zvdyIk.js";import{r as x}from"./index.DIfZGIpv.js";const f=["36","37","37.5","38","38.5","39","40","40.5","41","42","42.5","43","44","44.5","45","46","47","48","49"];function k({brands:i,currentBrand:a,currentGender:b,currentSize:n,currentSort:u}){const[r,m]=x.useState(!1),[o,p]=x.useState("");function l(t,c){const s=new URLSearchParams(window.location.search);c?s.set(t,c):s.delete(t),s.delete("pagina"),window.location.href=`/sneakers?${s.toString()}`}const h=i.filter(t=>t.name.toLowerCase().includes(o.toLowerCase())),g=[{value:"",label:"Alle"},{value:"heren",label:"Heren"},{value:"dames",label:"Dames"},{value:"unisex",label:"Unisex"}],v=[{value:"popular",label:"Populair"},{value:"newest",label:"Nieuwste"},{value:"price_asc",label:"Prijs ↑"},{value:"price_desc",label:"Prijs ↓"},{value:"discount",label:"Korting"}],d=e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3 text-xs font-bold uppercase tracking-widest text-text-muted",children:"Sorteer"}),e.jsx("select",{value:u,onChange:t=>l("sort",t.target.value),className:"w-full rounded-lg bg-bg-elevated px-3 py-2 text-sm text-text outline-none",children:v.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3 text-xs font-bold uppercase tracking-widest text-text-muted",children:"Maat"}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[n&&e.jsxs("button",{onClick:()=>l("maat",""),className:"rounded-lg bg-accent/20 px-2.5 py-1.5 text-xs font-bold text-accent",children:["✕ ",n]}),f.map(t=>e.jsx("button",{onClick:()=>l("maat",t),className:`rounded-lg px-2.5 py-1.5 text-xs font-bold transition-all ${n===t?"bg-accent text-bg":"bg-bg-elevated text-text-muted hover:text-text hover:bg-bg-elevated/80"}`,children:t},t))]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3 text-xs font-bold uppercase tracking-widest text-text-muted",children:"Geslacht"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:g.map(t=>e.jsx("button",{onClick:()=>l("geslacht",t.value),className:`rounded-xl px-3 py-1.5 text-xs font-bold transition-all ${b===t.value?"bg-accent text-bg":"bg-bg-elevated text-text-muted hover:text-text"}`,children:t.label},t.value))})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3 text-xs font-bold uppercase tracking-widest text-text-muted",children:"Merk"}),e.jsx("input",{type:"text",placeholder:"Zoek merk...",value:o,onChange:t=>p(t.target.value),className:"mb-2 w-full rounded-lg bg-bg-elevated px-3 py-2 text-sm text-text outline-none placeholder:text-text-muted"}),e.jsxs("div",{className:"max-h-48 space-y-1 overflow-y-auto",children:[a&&e.jsxs("button",{onClick:()=>l("merk",""),className:"flex w-full items-center gap-2 rounded-lg bg-accent/20 px-3 py-1.5 text-sm font-bold text-accent",children:["✕ ",a]}),h.map(t=>e.jsxs("button",{onClick:()=>l("merk",t.slug),className:`flex w-full items-center justify-between rounded-lg px-3 py-1.5 text-sm transition-colors ${a===t.slug?"bg-accent text-bg font-bold":"text-text-secondary hover:bg-bg-elevated"}`,children:[e.jsx("span",{children:t.name}),e.jsx("span",{className:"text-xs text-text-muted",children:t.count})]},t.slug))]})]}),e.jsx("button",{onClick:()=>{window.location.href="/sneakers"},className:"w-full rounded-xl border border-border/50 py-2 text-xs font-bold text-text-muted transition-colors hover:border-accent/50 hover:text-accent",children:"Filters wissen"})]});return e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>m(!r),className:"mb-4 flex w-full items-center justify-center gap-2 rounded-xl border border-border/50 bg-bg-card py-3 text-sm font-bold text-text-secondary lg:hidden",children:[e.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters ",r?"verbergen":"tonen"]}),r&&e.jsx("div",{className:"mb-6 rounded-2xl border border-border/50 bg-bg-card p-5 lg:hidden",children:d}),e.jsx("div",{className:"hidden lg:block",children:e.jsx("div",{className:"sticky top-24 rounded-2xl border border-border/50 bg-bg-card p-5",children:d})})]})}export{k as default};
