1import{j as e,c as m,s as u,L as h,o as x,g as f,r as g,a7 as j,av as v,aw as N}from"./index-CSVSqYDv.js";import{u as w}from"./useInfiniteQuery-CT0d4uHN.js";import{B as b}from"./index-CmMVVODi.js";import{I as y}from"./index-DtYgL8o8.js";import{M as k}from"./index-n7Zqdthy.js";import{I as M}from"./chunk-SNIEDJZS-CS-EQXYS.js";import{d as P,p as I,a as _,b as C,c as H}from"./page_districts_description-VUlcGbxZ.js";import{C as L}from"./chevron-left-Bi_-0VRC.js";import{s as D}from"./section-heading-CVaihF0t.js";import"./chevron-up-BknoYpJz.js";import"./arrow-left-DI4VGUPQ.js";function S({size:r=13,fill:a,...s}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:r,height:r,viewBox:"0 0 13 13",fill:"none",className:m("stroke-black/35 transition-opacity md:group-hover:stroke-black",s.className),...s,children:[e.jsx("title",{children:"Icon Project"}),e.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M7.007 7.464h2.026m0 0V.93A.42.42 0 0 0 8.607.5H4.873a.42.42 0 0 0-.426.429v4.065m4.586 2.47H12.5M7.38 3.821h1.653M6.367 2.214h2.666M8.18 5.43h.853M11.7 7.464V2.643a.42.42 0 0 0-.427-.429H9.14m1.227 1.607H11.7M10.367 5.43H11.7M4.873 7.786C6.047 8.107 6.9 9.232 6.9 10.518v.375m-3.627 0V7.036c0-.322.214-.536.534-.536h.533c.32 0 .533.214.533.536v3.857m-1.6-3.107c-1.173.321-2.026 1.446-2.026 2.732v.375M7.7 11.964c0 .322-.213.536-.533.536H1.033c-.32 0-.533-.214-.533-.536v-.535c0-.322.213-.536.533-.536h6.134c.32 0 .533.214.533.536z"})]})}const R="/assets/district-placeholder-QqySIDuM.png";function T({name:r,projectsCount:a,image:s,slug:i,className:n,altText:c}){const l=s?.startsWith("/")||s?.startsWith("http")?s:u(s||"");return e.jsxs(h,{to:"/districts/$districtSlug",params:{districtSlug:i},className:m("group flex min-h-28 w-full overflow-hidden rounded-[20px] border-3 border-primary/15 bg-white shadow-sm transition duration-300 ease-out active:scale-[0.99] md:min-h-0 md:flex-col md:hover:-translate-y-0.5 md:hover:border-primary/25 md:hover:shadow-lg",n),children:[e.jsx(M,{src:l,onError:o=>{o.currentTarget.src=R},width:640,height:420,className:"aspect-square w-28 shrink-0 object-cover md:aspect-[16/10] md:w-full",alt:c??r}),e.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-between gap-3 p-4 md:w-full md:items-end md:p-5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"truncate font-bold text-lg text-secondary capitalize md:text-xl",children:r}),e.jsxs("p",{className:"mt-2 flex items-center gap-2 text-muted-foreground text-sm",children:[e.jsx(S,{className:"size-4 text-primary"}),a," ",P()]})]}),e.jsx("span",{className:"grid size-9 shrink-0 place-items-center rounded-full bg-secondary/5 text-secondary transition md:group-hover:bg-secondary md:group-hover:text-white",children:e.jsx(L,{className:"size-4 ltr:rotate-180 rtl:rotate-0"})})]})]})}function G(){const{data:r,isLoading:a,isRefetching:s,hasNextPage:i,isFetchingNextPage:n,fetchNextPage:c}=w(x.districts.list.infiniteOptions({input:(t=1)=>({page:t}),getNextPageParam:t=>t.nextPage,initialPageParam:1})),l=f(),o=g.useRef(null);g.useEffect(()=>{if(!i||n)return;const t=new IntersectionObserver(([d])=>{d.isIntersecting&&c()},{rootMargin:"240px"});return o.current&&t.observe(o.current),()=>t.disconnect()},[c,i,n]);const p=r?.pages.flatMap(t=>t.items)??[];return e.jsxs(e.Fragment,{children:[e.jsx(k,{title:j()}),e.jsx(y,{kicker:C(),title:_(),description:I()}),e.jsx("main",{className:m(D.light,"py-8 pb-24 md:py-12 md:pb-24"),children:e.jsxs("div",{className:"layout grid gap-5 sm:grid-cols-2 lg:grid-cols-3",children:[a&&Array.from({length:6}).map((t,d)=>e.jsx("div",{className:"h-80 animate-pulse rounded-[20px] bg-secondary/10"},d)),!a&&p.length===0&&e.jsx("p",{className:"col-span-full py-24 text-center text-muted-foreground",children:H()}),p.map(t=>e.jsx(T,{name:N(t.slug,l,t.translations[l].title),image:v(t.slug,t.image),projectsCount:t.projectCount,slug:t.slug,altText:t.altText,className:m(s&&"opacity-50")},t.id)),i&&e.jsx("div",{ref:o,className:"col-span-full h-10"})]})}),e.jsx(b,{})]})}export{G 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.