1import{aw as c,a as m,h as u,j as s,L as g,y as x,F as p,p as f}from"./index-BTz-t5TX.js";import{u as o}from"./useQuery-lp6BC1FR.js";function j(){const{rubrika:r}=c.useSearch(),n=m(),{data:t}=o({queryKey:["categories","news"],queryFn:()=>p("news")}),{data:l,isLoading:d}=o({queryKey:["articles","news",r??"all"],queryFn:()=>f("news",r)}),a=(l??[]).map(e=>({slug:e.slug,title:e.title,subtitle:e.excerpt??"",image:e.cover_url??u,category:e.category?.name??"Vijesti",publishedAt:e.published_at??e.created_at})),i=e=>n({to:"/news",search:()=>e?{rubrika:e}:{}});return s.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-16",children:[s.jsxs("header",{className:"mb-8 border-b border-border pb-6",children:[s.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.2em] text-primary",children:"Najnovije"}),s.jsx("h1",{className:"mt-2 font-serif text-5xl text-foreground",children:"Vijesti"}),s.jsx("p",{className:"mt-3 text-muted-foreground",children:"Filmske i televizijske novosti, izvjeÅ¡taji s festivala i razgovori."})]}),t&&t.length>0&&s.jsxs("div",{className:"mb-10 flex flex-wrap gap-2",children:[s.jsx("button",{onClick:()=>i(void 0),className:`rounded-full px-4 py-1.5 text-xs font-semibold uppercase tracking-widest transition-colors ${r?"bg-surface text-muted-foreground ring-1 ring-primary hover:text-foreground":"bg-primary text-primary-foreground"}`,children:"Sve"}),t.map(e=>s.jsx("button",{onClick:()=>i(e.slug),className:`rounded-full px-4 py-1.5 text-xs font-semibold uppercase tracking-widest transition-colors ${r===e.slug?"bg-primary text-primary-foreground":"bg-surface text-muted-foreground ring-1 ring-primary hover:text-foreground"}`,children:e.name},e.id))]}),d?s.jsx("p",{className:"text-muted-foreground",children:"UÄitavanjeâ¦"}):a.length===0?s.jsx("p",{className:"text-muted-foreground",children:"Nema Älanaka u ovoj rubrici."}):s.jsx("div",{className:"grid grid-cols-1 gap-12 md:grid-cols-2 lg:grid-cols-3",children:a.map(e=>s.jsxs(g,{to:"/news/$slug",params:{slug:e.slug},className:"group",children:[s.jsx("div",{className:"aspect-[16/10] overflow-hidden rounded-md ring-1 ring-border",children:s.jsx("img",{src:e.image,alt:e.title,loading:"lazy",className:"size-full object-cover transition-transform duration-700 group-hover:scale-105"})}),s.jsx("span",{className:"mt-4 block text-[10px] font-semibold uppercase tracking-widest text-primary",children:e.category}),s.jsx("h3",{className:"mt-1 font-serif text-xl leading-snug text-foreground group-hover:text-primary",children:e.title}),s.jsx("p",{className:"mt-2 text-sm text-foreground/85",children:e.subt
1itle}),s.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:x(e.publishedAt)})]},e.slug))})]})}export{j 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.