1import{j as e,d as m,bc as f,bd as y,B as v,ao as x,K as b,a0 as g,a1 as C,u as P,a9 as w,r as o,bG as M,x as E,y as T,gF as j,f as n,cm as S}from"./index-DPD08fmB.js";import{u as U}from"./useDebounce-j2tPyEtZ.js";import{u as I}from"./useLivePhotos-iwa76hcH.js";import"./livePhotos.service-D9LKUc_a.js";function B({event:a}){const l={PUBLISHED:"bg-blue-500",UPCOMING:"bg-purple-500",ACTIVE:"bg-green-500"};return e.jsxs(m,{children:[e.jsx(f,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx(y,{className:"text-lg",children:a.name}),e.jsx(v,{variant:"secondary",className:`${l[a.status]} text-white`,children:a.status})]})}),e.jsxs(x,{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(b,{className:"h-4 w-4"}),e.jsxs("span",{children:[g(new Date(a.startTime),"MMM d, yyyy"),a.endTime&&e.jsxs(e.Fragment,{children:[" - ",g(new Date(a.endTime),"MMM d, yyyy")]})]})]}),a.location&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(C,{className:"h-4 w-4"}),e.jsx("span",{children:a.location})]})]})]})}function k(){const{t:a}=P(),l=w(),[h,p]=o.useState(""),[r,u]=o.useState(0),N=U(h,300),{data:t,isLoading:i,error:c}=I({search:N,page:r,size:12}),d=o.useMemo(()=>(t==null?void 0:t.content)??[],[t]);return e.jsxs("div",{className:"container mx-auto space-y-6 p-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-3xl font-bold",children:"Live Event Photos"}),e.jsx("p",{className:"text-muted-foreground",children:"Upload and manage photo batches for your events"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(M,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(E,{placeholder:"Search events...",value:h,onChange:s=>p(s.target.value),className:"pl-10"})]}),i&&e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(T,{className:"h-8 w-8 animate-spin text-muted-foreground"})}),c&&e.jsx(m,{children:e.jsx(x,{className:"py-12 text-center",children:e.jsx("p",{className:"text-destructive",children:"Failed to load events. Please try again."})})}),!i&&!c&&d.length===0&&e.jsx(m,{children:e.jsxs(x,{className:"py-12 text-center",children:[e.jsx(j,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"mt-4 text-muted-foreground",children:"No upload-eligible events found."}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Events become eligible when their status is PUBLISHED, UPCOMING, or ACTIVE and they ended within the last 7 days."})]})}),!i&&!c&&d.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:d.map(s=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{event:s}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(n,{onClick:()=>l(`/admin/live-photos/${s.id}/new-batch`),className:"flex-1",size:"sm",children:[e.jsx(S,{className:"mr-2 h-4 w-4"}),"Upload Photos"]}),e.jsxs(n,{onClick:()=>l(`/admin/live-photos/${s.id}/batches`),variant:"outline",className:"flex-1",size:"sm",children:[e.jsx(j,{className:"mr-2 h-4 w-4"}),"View Batches"]})]})]},s.id))}),t&&t.totalPages>1&&e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx(n,{onClick:()=>u(s=>Math.max(0,s-1)),disabled:r===0,variant:"outline",size:"sm",children:"Previous"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",r+1," of ",t.totalPages]}),e.jsx(n,{onClick:()=>u(s=>Math.min(t.totalPages-1,s+1)),disabled:r>=t.totalPages-1,variant:"outline",size:"sm",children:"Next"})]})]})]})}export{k 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.