1import{X as w,r,j as e,S as C,A as S}from"./client-BdA7rF3J.js";import{S as l}from"./StatCard-i437S5Vr.js";function j(){const{logs:i,stats:t,teams:v,year:N,availableYears:f,filters:o}=w().props,[m,y]=r.useState(N),[c,p]=r.useState(o.team||""),[d,h]=r.useState(o.disposed||""),[u,x]=r.useState(null),[g,_]=r.useState({}),n=(s={})=>{const a={year:s.year??m,team:s.team??c,disposed:s.disposed??d};Object.keys(a).forEach(b=>{a[b]||delete a[b]}),S.get(route("cleanup-challenge.admin.logs"),a,{preserveState:!0})},k=s=>{_(a=>({...a,[s]:!a[s]}))};return e.jsxs(e.Fragment,{children:[e.jsx(C,{title:"Cleanup Logs - Admin"}),u&&e.jsx("div",{className:"fixed inset-0 z-50 bg-black/80 flex items-center justify-center p-4",onClick:()=>x(null),children:e.jsxs("div",{className:"relative max-w-4xl max-h-[90vh]",children:[e.jsx("button",{onClick:()=>x(null),className:"absolute -top-10 right-0 text-white text-3xl hover:text-gray-300",children:"Ã"}),e.jsx("img",{src:u,className:"max-w-full max-h-[85vh] rounded-lg shadow-2xl",alt:"Cleanup photo"})]})}),e.jsxs("div",{className:"min-h-screen bg-gray-50",children:[e.jsx("header",{className:"bg-white border-b shadow-sm",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex items-center justify-between h-16",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("img",{src:"https://cdn.cbaip.org/wp-content/uploads/2024/12/11113843/1.png",alt:"Keep Soddy-Daisy Beautiful",className:"h-10 w-auto"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-gray-900",children:"Cleanup Challenge"}),e.jsx("div",{className:"text-xs text-gray-500",children:"Cleanup Logs"})]})]}),e.jsx("div",{className:"flex items-center space-x-4",children:e.jsx("a",{href:route("cleanup-challenge.admin"),className:"text-sm text-green-600 hover:text-green-700 font-medium",children:"â Teams Overview"})})]})})}),e.jsxs("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"bg-white rounded-xl shadow-sm border p-4 mb-6",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-gray-500 block mb-1",children:"Year"}),e.jsx("select",{value:m,onChange:s=>{const a=parseInt(s.target.value);y(a),n({year:a})},className:"px-3 py-1.5 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-green-500 focus:border-transparent",children:f.map(s=>e.jsx("option",{value:s,children:s},s))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-gray-500 block mb-1",children:"Team"}),e.jsxs("select",{value:c,onChange:s=>{p(s.target.value),n({team:s.target.value})},className:"px-3 py-1.5 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-green-500 focus:border-transparent",children:[e.jsx("option",{value:"",children:"All Teams"}),v.map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-gray-500 block mb-1",children:"Disposal Status"}),e.jsxs("select",{value:d,onChange:s=>{h(s.target.value),n({disposed:s.target.value})},className:"px-3 py-1.5 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-green-500 focus:border-transparent",children:[e.jsx("option",{value:"",children:"All"}),e.jsx("option",{value:"yes",children:"Disposed"}),e.jsx("option",{value:"no",children:"Pending Pickup"})]})]}),(c||d)&&e.jsx("div",{className:"flex items-end",children:e.jsx("button",{onClick:()=>{p(""),h(""),n({team:"",disposed:""})},className:"text-sm text-red-500 hover:text-red-700 px-3 py-1.5",children:"Clear Filters"})})]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4 mb-6",children:[e.jsx(l,{label:"Cleanup Logs",value:t.total_logs,variant:"compact"}),e.jsx(l,{label:"Bags Collected",value:t.total_bags,variant:"compact"}),e.jsx(l,{label:"Tires",value:t.total_tires,variant:"compact"}),e.jsx(l,{label:"Large Items",value:t.total_large_items,variant:"compact"}),e.jsx(l,{label:"Pending Pickup",value:t.pending_pickup,variant:"compact",className:t.pending_pickup>0?"ring-2 ring-amber-300":""})]}),i.length>0?e.jsx("div",{className:"space-y-4",children:i.map(s=>e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border overflow-hidden",children:[e.jsx("div",{className:"p-4 cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>k(s.id),children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx("div",{className:`w-2 h-2 rounded-full mt-2 flex-shrink-0 ${s.trash_dis
1posed?"bg-green-500":"bg-amber-500"}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"font-semibold text-gray-900",children:s.team.name}),e.jsxs("span",{className:"text-xs text-gray-400",children:["#",s.id]})]}),e.jsxs("div",{className:"text-sm text-gray-600 mt-0.5",children:[s.date_formatted," · ",s.location||"No location"]})]})]}),e.jsxs("div",{className:"flex items-center space-x-4 text-sm",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[s.bag_count>0&&e.jsxs("span",{className:"text-blue-600 font-medium",title:"Bags",children:["ðï¸ ",s.bag_count]}),s.tire_count>0&&e.jsxs("span",{className:"text-amber-600 font-medium",title:"Tires",children:["â ",s.tire_count]}),s.large_item_count>0&&e.jsxs("span",{className:"text-purple-600 font-medium",title:"Large Items",children:["ð¦ ",s.large_item_count]})]}),s.photos.length>0&&e.jsxs("span",{className:"text-gray-400 text-xs",children:["ð· ",s.photos.length]}),e.jsx("svg",{className:`w-5 h-5 text-gray-400 transition-transform ${g[s.id]?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]})}),g[s.id]&&e.jsxs("div",{className:"border-t px-4 pb-4",children:[e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 py-4",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-gray-500 block",children:"Bags"}),e.jsx("span",{className:"text-lg font-semibold text-blue-600",children:s.bag_count})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-gray-500 block",children:"Tires"}),e.jsx("span",{className:"text-lg font-semibold text-amber-600",children:s.tire_count})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-gray-500 block",children:"Large Items"}),e.jsx("span",{className:"text-lg font-semibold text-purple-600",children:s.large_item_count})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-gray-500 block",children:"Disposed"}),e.jsx("span",{className:`text-lg font-semibold ${s.trash_disposed?"text-green-600":"text-amber-600"}`,children:s.trash_disposed?"Yes â":"No â Pending"})]})]}),s.description&&e.jsxs("div",{className:"mb-3",children:[e.jsx("span",{className:"text-xs text-gray-500 block mb-1",children:"Description"}),e.jsx("p",{className:"text-sm text-gray-700 bg-gray-50 rounded-lg p-3",children:s.description})]}),s.notes&&e.jsxs("div",{className:"mb-3",children:[e.jsx("span",{className:"text-xs text-gray-500 block mb-1",children:"Notes"}),e.jsx("p",{className:"text-sm text-gray-700 bg-gray-50 rounded-lg p-3",children:s.notes})]}),!s.trash_disposed&&s.trash_location&&e.jsxs("div",{className:"mb-3",children:[e.jsx("span",{className:"text-xs text-gray-500 block mb-1",children:"Trash Left At"}),e.jsxs("p",{className:"text-sm text-amber-700 bg-amber-50 rounded-lg p-3 border border-amber-200",children:["ð ",s.trash_location]})]}),e.jsxs("div",{className:"flex flex-wrap gap-4 text-xs text-gray-400 mb-3",children:[s.team_members_present&&e.jsxs("span",{children:["ð¥ ",s.team_members_present," members present"]}),s.submitted_by_email&&e.jsxs("span",{children:["âï¸ ",s.submitted_by_email]}),e.jsxs("span",{children:["Submitted ",s.created_at]})]}),s.photos.length>0&&e.jsxs("div",{children:[e.jsxs("span",{className:"text-xs text-gray-500 block mb-2",children:["Photos (",s.photos.length,")"]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-2",children:s.photos.map(a=>e.jsxs("div",{className:"cursor-pointer group relative aspect-square rounded-lg overflow-hidden bg-gray-100",onClick:()=>x(a.url),children:[e.jsx("img",{src:a.url,alt:a.original_name||"Cleanup photo",className:"w-full h-full object-cover group-hover:scale-105 transition-transform",loading:"lazy"}),e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors"})]},a.id))})]})]})]},s.id))}):e.jsx("div",{className:"bg-white rounded-xl shadow-sm border p-8 text-center text-gray-500",children:e.jsx("p",{children:"No cleanup logs found for the selected filters."})})]})]})]})}j.layout=i=>i;const P=Object.freeze(Object.defineProperty({__proto__:null,default:j},Symbol.toStringTag,{value:"Module"}));
1export{P as _};
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.