1import{l as h,H as g,r as n,D as f,s as j,j as s,L as m}from"./index-CUjBj9Vf.js";import{T as b,a as N,b as v,c as y}from"./tabs-C5Mi-nMk.js";import{P as w}from"./plus-CjBz96bZ.js";import{L as T,T as d,B as C}from"./trophy-CvqJWTve.js";import"./index-DBV5DEqJ.js";import"./index-D63pd20I.js";const c=[{value:"commission",label:"Dorpscommissies",icon:T,cats:["commission"]},{value:"associations",label:"Verenigingen & Clubs",icon:d,cats:["sports","business"]}];function B(){const{isCommittee:u}=h(),{village:i}=g(),[x,p]=n.useState("commission"),o=f({queryKey:["committees-public",i?.id],enabled:!!i?.id,queryFn:async()=>{const{data:e,error:a}=await j.from("committees").select("id,slug,name,logo_url,sort_order,show_in_menu,category").eq("village_id",i.id).order("sort_order");if(a)throw a;return(e??[]).map(l=>({...l,category:l.category??"commission"}))}}),r=o.data??[],t=n.useMemo(()=>{const e={commission:[],associations:[]};return r.forEach(a=>{a.category==="commission"?e.commission.push(a):e.associations.push(a)}),e},[r]);return s.jsxs("main",{className:"container-app py-4",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-display text-2xl font-bold",children:"Ons Dorp"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Commissies, verenigingen & clubs uit ons dorp."})]}),u&&s.jsxs(m,{to:"/commissies/beheer",className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-2 text-xs font-semibold text-primary-foreground",children:[s.jsx(w,{className:"h-3.5 w-3.5"})," CMS"]})]}),s.jsxs(b,{value:x,onValueChange:e=>p(e),className:"mt-4",children:[s.jsx(N,{className:"grid w-full grid-cols-2",children:c.map(e=>s.jsxs(v,{value:e.value,className:"gap-1.5",children:[s.jsx(e.icon,{className:"h-3.5 w-3.5"})," ",e.label]},e.value))}),c.map(e=>s.jsx(y,{value:e.value,className:"mt-4",children:s.jsxs("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[t[e.value].map(a=>s.jsx("li",{children:s.jsxs(m,{to:"/commissies/$cat",params:{cat:a.slug},className:"flex items-center gap-3 rounded-lg border bg-card p-3 transition-shadow hover:shadow-md",children:[s.jsx("div",{className:"h-14 w-14 shrink-0 overflow-hidden rounded bg-muted",children:a.logo_url?s.jsx("img",{src:a.logo_url,alt:a.name,className:"h-full w-full object-cover"}):s.jsx("div",{className:"flex h-full w-full items-center justify-center text-xs font-semibold text-muted-foreground",children:a.name.slice(0,2).toUpperCase()})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h2",{className:"truncate font-display text-base font-bold",children:a.name}),s.jsx("p",{className:"text-xs font-semibold text-primary",children:"Bekijken â"})]}),e.value==="associations"&&s.jsx("span",{className:"shrink-0 text-muted-foreground",children:a.category==="sports"?s.jsx(d,{className:"h-4 w-4"}):s.jsx(C,{className:"h-4 w-4"})})]})},a.id)),t[e.value].length===0&&o.isSuccess&&s.jsx("li",{className:"text-sm text-muted-foreground",children:"Nog niets in deze groep."}),t[e.value].length===0&&!o.isSuccess&&s.jsx("li",{className:"text-sm text-muted-foreground",children:"Ladenâ¦"})]})},e.value))]})]})}export{B as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.