1import{j as e}from"./vendor-ui-CEGjIuqP.js";import{s as b,f as j,N,P as w,a as d,F as y,aW as v,aX as k,B as i,X as C,C as P,d as E}from"./index-DgkqAiwu.js";import{r}from"./vendor-react-BT-Op1j_.js";import"./vendor-dnd-D3FEUJ2d.js";import"./vendor-editor-CAsPUtf2.js";import"./vendor-data-CqtBkUbK.js";import"./vendor-charts-F376sfYw.js";const F=()=>{const[a,x]=r.useState([]),[m,g]=r.useState(!0),[t,s]=r.useState(null);r.useEffect(()=>{p()},[]);const p=async()=>{try{const{data:o,error:l}=await b.from("gallery_photos").select("*").order("photo_order",{ascending:!0});if(l)throw l;x(o||[])}catch(o){console.error("Error loading photos:",o)}finally{g(!1)}},u=o=>{s(o)},n=()=>{s(null)},c=()=>{t!==null&&t>0&&s(t-1)},h=()=>{t!==null&&t<a.length-1&&s(t+1)},f=o=>{o.key==="ArrowLeft"&&c(),o.key==="ArrowRight"&&h(),o.key==="Escape"&&n()};return e.jsxs(e.Fragment,{children:[e.jsx(j,{titlePrefix:"Photo Gallery"}),e.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[e.jsx(N,{}),e.jsx("main",{className:"flex-1 pt-page",children:e.jsx(w,{pageName:"photo-gallery",sections:[{id:"hero",component:e.jsx("section",{className:"pt-page pb-5",children:e.jsxs("div",{className:"container mx-auto px-4 text-center",children:[e.jsx(d,{pageName:"photo-gallery",sectionName:"hero",contentKey:"title",defaultValue:"Show Photo Gallery",className:"text-4xl md:text-5xl font-bold mb-4 text-gradient-title",as:"h1"}),e.jsx(d,{pageName:"photo-gallery",sectionName:"hero",contentKey:"subtitle",defaultValue:"Explore our collection of event photos",className:"text-xl text-muted-foreground w-full",as:"p"})]})})},{id:"gallery",component:e.jsx("section",{className:"py-16",children:e.jsx("div",{className:"container mx-auto px-4",children:m?e.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"Loading photos..."}):a.length===0?e.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No photos available"}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:a.map((o,l)=>e.jsx("div",{className:"aspect-[4/3] bg-muted rounded-lg overflow-hidden cursor-pointer hover:opacity-90 transition-opacity",onClick:()=>u(l),children:e.jsx("img",{src:o.photo_url,alt:`Gallery photo ${l+1}`,className:"w-full h-full object-cover"})},o.id))})})})}]})}),e.jsx(y,{})]}),e.jsx(v,{open:t!==null,onOpenChange:n,children:e.jsx(k,{className:"max-w-[95vw] w-full h-[95vh] p-0 bg-black/95 border-0 [&>button]:hidden overflow-hidden",onKeyDown:f,children:t!==null&&a[t]&&e.jsxs("div",{className:"relative w-full h-full flex items-center justify-center p-4",children:[e.jsx(i,{variant:"ghost",size:"icon","aria-label":"Close photo lightbox",className:"absolute top-4 right-4 text-white hover:bg-white/20 bg-black/50 z-50 h-10 w-10 rounded-full",onClick:n,children:e.jsx(C,{className:"h-6 w-6"})}),t>0&&e.jsx(i,{variant:"ghost",size:"icon","aria-label":"Previous photo",className:"absolute left-4 top-1/2 -translate-y-1/2 text-white hover:bg-white/20 bg-black/50 h-12 w-12 z-50 rounded-full",onClick:c,children:e.jsx(P,{className:"h-8 w-8"})}),e.jsx("img",{src:a[t].photo_url,alt:`Gallery photo ${t+1}`,className:"max-w-[calc(100%-8rem)] max-h-[calc(100%-4rem)] w-auto h-auto object-contain"}),t<a.length-1&&e.jsx(i,{variant:"ghost",size:"icon","aria-label":"Next photo",className:"absolute right-4 top-1/2 -translate-y-1/2 text-white hover:bg-white/20 bg-black/50 h-12 w-12 z-50 rounded-full",onClick:h,children:e.jsx(E,{className:"h-8 w-8"})}),e.jsxs("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 text-white text-sm bg-black/50 px-3 py-1 rounded-full",children:[t+1," / ",a.length]})]})})})]})};export{F as default};
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.