1import{r as a,h as i,j as e,L as p}from"./index-Bj_V9Is2.js";import{N as g}from"./Navbar-oMDsdy5-.js";import{F as f}from"./Footer-LffyC8oL.js";import{I as j}from"./input-CDqZwMjE.js";import{C as w,A as N,a as b}from"./card-3nrGqY3Q.js";import{c as v}from"./createLucideIcon-CWIq_39t.js";import"./x-DA1vm-qO.js";import"./utils-BB1SQE6n.js";import"./index-B8-uZzVA.js";const y=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],C=v("search",y);function T(){const[t,o]=a.useState(""),[n,m]=a.useState(i),[c,r]=a.useState(null),d=Array.from(new Set(i.map(s=>s.category)));return a.useEffect(()=>{const s=i.filter(l=>{const x=l.title.toLowerCase().includes(t.toLowerCase())||l.content.toLowerCase().includes(t.toLowerCase())||l.tags.some(u=>u.toLowerCase().includes(t.toLowerCase())),h=c?l.category===c:!0;return x&&h});m(s)},[t,c]),e.jsxs("div",{className:"destini-scope min-h-screen flex flex-col",children:[e.jsx(g,{}),e.jsx("div",{className:"flex-grow bg-gray-50",children:e.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 py-24",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h1",{className:"text-4xl font-bold text-cosmic mb-4",children:"Destini.ai Blog"}),e.jsx("p",{className:"text-cosmic/70 text-lg max-w-2xl mx-auto",children:"Explore our collection of articles on Vedic wisdom, AI predictions, spiritual growth, and practical applications of ancient knowledge in modern life."})]}),e.jsxs("div",{className:"mb-10 flex flex-col md:flex-row gap-4 items-center justify-between",children:[e.jsxs("div",{className:"relative w-full md:w-1/2",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:e.jsx(C,{className:"h-5 w-5 text-cosmic/50"})}),e.jsx(j,{type:"text",placeholder:"Search articles, topics, or tags...",className:"pl-10 w-full bg-white shadow-sm",value:t,onChange:s=>o(s.target.value)})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 justify-center md:justify-end",children:[e.jsx("button",{className:`px-4 py-2 rounded-full text-sm font-medium transition-colors ${c===null?"bg-cosmic-purple text-white":"bg-white text-cosmic hover:bg-cosmic-purple/10"}`,onClick:()=>r(null),children:"All"}),d.map(s=>e.jsx("button",{className:`px-4 py-2 rounded-full text-sm font-medium transition-colors ${c===s?"bg-cosmic-purple text-white":"bg-white text-cosmic hover:bg-cosmic-purple/10"}`,onClick:()=>r(s),children:s},s))]})]}),n.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:n.map(s=>e.jsx(p,{to:"/blog/$id",params:{id:s.id},className:"group",children:e.jsxs(w,{className:"bg-white rounded-lg overflow-hidden shadow-md hover:shadow-lg transition-shadow duration-300 h-full",children:[e.jsx("div",{className:"overflow-hidden",children:e.jsx(N,{ratio:16/9,className:"bg-muted",children:e.jsx("img",{src:s.imageUrl,alt:s.title,className:"w-full h-full object-cover transform group-hover:scale-105 transition-transform duration-300"})})}),e.jsxs(b,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center mb-3",children:[e.jsx("span",{className:"text-xs font-medium px-2 py-1 rounded-full bg-cosmic-purple/10 text-cosmic-purple",children:s.category}),e.jsxs("span",{className:"text-xs text-cosmic/60 ml-auto",children:[s.readTime," min read"]})]}),e.jsx("h3",{className:"text-xl font-bold mb-2 group-hover:text-cosmic-purple transition-colors",children:s.title}),e.jsx("p",{className:"text-cosmic/70 mb-4 line-clamp-2",children:s.excerpt}),e.jsx("div",{className:"text-sm",children:e.jsx("span",{className:"text-cosmic/60",children:new Date(s.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})})]})]})},s.id))}):e.jsxs("div",{className:"text-center py-16 bg-white rounded-lg shadow",children:[e.jsx("p",{className:"text-xl text-cosmic/70",children:"No posts found matching your search criteria."}),e.jsx("button",{className:"mt-4 px-6 py-2 bg-cosmic-purple text-white rounded-full hover:bg-cosmic-accent transition-colors",onClick:()=>{o(""),r(null)},children:"Clear Filters"})]})]})})}),e.jsx(f,{})]})}
1export{T as component};
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.