PageSourceSearch

https://keepsoddydaisybeautiful.org/build/assets/Index-8mvRWU0c.js

js keepsoddydaisybeautiful.org collected 2026-10-05 22:03:48 UTC 7,880 bytes, 1 lines download raw bytes

1import{r as i,j as e,S as y,x as l,A as p}from"./client-BdA7rF3J.js";import{B as j}from"./Breadcrumbs-S4TKG4SO.js";function f({announcements:r}){const[s,o]=i.useState(""),[a,u]=i.useState("all"),b=t=>{confirm("Delete this announcement?")&&p.delete(route("announcements.destroy",t))},d=i.useMemo(()=>r.filter(t=>{var x,c,m,g,h;if(a==="published"&&!t.is_published||a==="draft"&&t.is_published)return!1;if(s){const n=s.toLowerCase();return((x=t.title)==null?void 0:x.toLowerCase().includes(n))||((c=t.body)==null?void 0:c.toLowerCase().includes(n))||((g=(m=t.committee)==null?void 0:m.name)==null?void 0:g.toLowerCase().includes(n))||((h=t.event_location)==null?void 0:h.toLowerCase().includes(n))}return!0}),[r,s,a]);return e.jsxs(e.Fragment,{children:[e.jsx(y,{title:"Announcements"}),e.jsx("header",{className:"bg-white dark:bg-gray-800 shadow",children:e.jsxs("div",{className:"max-w-8xl mx-auto py-6 px-4",children:[e.jsx("div",{className:"mb-4",children:e.jsx(j,{items:[{label:"Dashboard",href:route("dashboard")},{label:"Announcements"}]})}),e.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-3",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Announcements"}),e.jsxs(l,{href:route("announcements.create"),className:"inline-flex items-center gap-2 px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-sm font-medium transition",children:[e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"New Announcement"]})]})]})}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:[r.length>0&&e.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-sm p-4 mb-6",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"search",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Search"}),e.jsxs("div",{className:"relative",children:[e.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),e.jsx("input",{type:"text",id:"search",value:s,onChange:t=>o(t.target.value),placeholder:"Search by title, content, committee...",className:"w-full pl-10 pr-3 py-2 rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white shadow-sm focus:border-indigo-500 focus:ring-indigo-500 text-sm"})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"status",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Status"}),e.jsxs("select",{id:"status",value:a,onChange:t=>u(t.target.value),className:"w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white shadow-sm focus:border-indigo-500 focus:ring-indigo-500 text-sm",children:[e.jsxs("option",{value:"all",children:["All (",r.length,")"]}),e.jsxs("option",{value:"published",children:["Published (",r.filter(t=>t.is_published).length,")"]}),e.jsxs("option",{value:"draft",children:["Drafts (",r.filter(t=>!t.is_published).length,")"]})]})]})]}),s&&e.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[e.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Showing ",d.length," of ",r.length," announcements"]}),e.jsx("button",{onClick:()=>o(""),className:"text-sm text-indigo-600 hover:text-indigo-800 dark:text-indigo-400",children:"Clear search"})]})]}),r.length===0?e.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow text-center py-16",children:[e.jsx("svg",{className:"w-16 h-16 text-gray-300 dark:text-gray-600 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5.882V19.24a1.76 1.76 0 01-3.417.592l-2.147-6.15M18 13a3 3 0 100-6M5.436 13.683A4.001 4.001 0 017 6h1.832c4.1 0 7.625-1.234 9.168-3v14c-1.543-1.766-5.067-3-9.168-3H7a3.988 3.988 0 01-1.564-.317z"})}),e.jsx("h3",{className:"mt-4 text-lg font-medium text-gray-900 dark:text-gray-100",children:"No announcements yet"}),e.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:"Create an announcement to share news with the community."}),e.jsx("div",{className:"mt-6",children:e.jsx(l,{href:route("announcements.create"),className:"inline-flex items-center gap-2 px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-sm font-medium transition",children:"Create Announcement"})})]}):d.length===0?e.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow text-center py-12",children:[e.jsx("svg",{className:"w-12 h-12 text-gray-300 dark:text-gray-600 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),e.jsx("h3",{className:"mt-4 text-lg font-medium text-gray-900 dark:text-gray-100",children:"No matching announcements"}),e.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:"Try adjusting your search term or filter."})]}):e.jsx("div",{className:"space-y-4",children:d.map(t=>e.jsx("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow p-6",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-1",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:t.title}),e.jsx("span",{className:`inline-flex px-2 py-0.5 text-xs font-medium rounded-full ${t.is_published?"bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200":"bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300"}`,children:t.is_published?"Published":"Draft"}),t.committee&&e.jsx("span",{className:"inline-flex px-2 py-0.5 text-xs font-medium rounded-full bg-indigo-100 dark:bg-indigo-900 text-indigo-700 dark:text-indigo-300",children:t.committee.name})]}),(t.event_date||t.event_time||t.event_location)&&e.jsxs("div",{className:"flex items-center gap-3 text-sm text-green-700 dark:text-green-400 mb-2 flex-wrap",children:[t.event_date&&e.jsx("span",{children:t.event_date}),t.event_time&&e.jsx("span",{children:t.event_time}),t.event_location&&e.jsx("span",{children:t.event_location})]}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 line-clamp-2 mb-2",children:t.body}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-400 dark:text-gray-500",children:[e.jsxs("span",{children:["Created ",t.created_at,t.created_by&&` by ${t.created_by}`]}),(t.starts_at||t.ends_at)&&e.jsxs("span",{children:["Visible ",t.starts_at&&`from ${t.starts_at}`,t.ends_at&&` until ${t.ends_at}`]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-4 shrink-0",children:[e.jsx(l,{href:route("announcements.edit",t.id),className:"px-3 py-1.5 text-sm text-gray-600 dark:text-gray-400 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition",children:"Edit"}),e.jsx("button",{onClick:()=>b(t.id),className:"px-3 py-1.5 text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 hover:bg-red-100 dark:hover:bg-red-900/40 rounded-lg transition",children:"Delete"})]})]})},t.id))})]})]})}const N=Object.freeze(Object.defineProperty({__proto__:null,default:f},Symbol.toStringTag,{value:"Module"}));
1export{N 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.