import{j as t}from"./jsx-runtime.D_zvdyIk.js";import{r as i}from"./index.C5BVv2q5.js";function c({posts:s}){const[a,l]=i.useState(""),r=s.filter(e=>e.data.title.toLowerCase().includes(a.toLowerCase())||e.data.tag.toLowerCase().includes(a.toLowerCase()));return t.jsxs("div",{class:"max-w-7xl mx-auto px-6 mb-6 items-center mt-6",children:[t.jsxs("div",{class:"relative max-w-2xl",children:[t.jsx("input",{type:"text",placeholder:"Search by title or tag (e.g. 'Kandy', 'Wildlife')...",class:"w-full p-5 pl-14 bg-white rounded-3xl border-none ring-1 ring-slate-200 focus:ring-2 focus:ring-primary shadow-sm outline-none transition-all",onInput:e=>l(e.currentTarget.value)}),t.jsx("span",{class:"absolute left-5 top-1/2 -translate-y-1/2 opacity-30 text-xl",children:"🔍"})]}),t.jsxs("p",{class:"mt-4 text-sm text-slate-500 italic",children:["Showing ",r.length," of ",s.length," stories"]}),t.jsx("div",{class:"grid grid-cols-1 md:grid-cols-3 gap-8 mt-12",children:r.map(e=>t.jsx("div",{class:"animate-in fade-in zoom-in duration-300"},e.slug))})]})}export{c as default};
