1import{j as e,L as d,h as f,r as m}from"./react-vendor-C-_weJGF.js";import{I as b}from"./input-TSEJWV9X.js";import{b as x,c as g,P as j}from"./index-DiEum5Ju.js";import{f as u}from"./format-Cpjm9erV.js";import{l as y}from"./icons-BZJMmL1V.js";import"./query-DA-B5yju.js";import"./radix-CMA3xQgM.js";import"./supabase-BppBjPB2.js";import"./motion-CfmjrLVm.js";function N({currentSlug:i,currentCategory:l}){const{data:a=[]}=x(),{data:n=[]}=g(),t=n.filter(r=>r.slug!==i).slice(0,5);return e.jsxs("aside",{className:"space-y-8",children:[a.length>0&&e.jsxs("div",{className:"glass border border-border/30 rounded-lg p-5",children:[e.jsx("h3",{className:"font-display font-semibold text-sm uppercase tracking-wide text-foreground mb-4",children:"Categories"}),e.jsxs("ul",{className:"space-y-2",children:[e.jsx("li",{children:e.jsx(d,{to:"/blog",className:`text-sm transition-colors ${l?"text-muted-foreground hover:text-foreground":"text-primary font-medium"}`,children:"All Posts"})}),a.map(r=>e.jsx("li",{children:e.jsx(d,{to:`/blog?category=${r.slug}`,className:`text-sm transition-colors ${l===r.slug?"text-primary font-medium":"text-muted-foreground hover:text-foreground"}`,children:r.name})},r.id))]})]}),t.length>0&&e.jsxs("div",{className:"glass border border-border/30 rounded-lg p-5",children:[e.jsx("h3",{className:"font-display font-semibold text-sm uppercase tracking-wide text-foreground mb-4",children:"Recent Posts"}),e.jsx("ul",{className:"space-y-4",children:t.map(r=>e.jsx("li",{children:e.jsxs(d,{to:`/blog/${r.slug}`,className:"group block",children:[e.jsx("h4",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors line-clamp-2",children:r.title}),r.published_at&&e.jsx("span",{className:"text-xs text-muted-foreground/70 mt-1 block",children:u(new Date(r.published_at),"MMM d, yyyy")})]})},r.id))})]})]})}function $(){const[i]=f(),l=i.get("category")||"",[a,n]=m.useState(""),[t,r]=m.useState(l),{data:h=[]}=g(t||void 0),{data:p=[]}=x(),c=h.filter(s=>{var o;return s.title.toLowerCase().includes(a.toLowerCase())||((o=s.excerpt)==null?void 0:o.toLowerCase().includes(a.toLowerCase()))});return e.jsx(j,{title:"Blog - Streamline Factory",description:"Insights and updates from Streamline Factory.",slug:"blog",children:e.jsx("div",{className:"pb-8 section-padding",children:e.jsxs("div",{className:"container-narrow mx-auto",children:[e.jsx("h1",{className:"font-display text-4xl font-bold mb-4",children:"Blog"}),e.jsx("p",{className:"text-muted-foreground mb-8",children:"Insights, updates, and guides from our team."}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-8",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap gap-4 mb-8",children:[e.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[e.jsx(y,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(b,{placeholder:"Search posts...",value:a,onChange:s=>n(s.target.value),className:"pl-10 bg-secondary border-border"})]}),e.jsxs("div",{className:"flex gap-2 flex-wrap lg:hidden",children:[e.jsx("button",{onClick:()=>r(""),className:`px-3 py-1.5 rounded-full text-xs transition-colors ${t?"bg-secondary text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"}`,children:"All"}),p.map(s=>e.jsx("button",{onClick:()=>r(s.slug),className:`px-3 py-1.5 rounded-full text-xs transition-colors ${t===s.slug?"bg-primary text-primary-foreground":"bg-secondary text-muted-foreground hover:text-foreground"}`,children:s.name},s.slug))]})]}),c.length===0?e.jsx("div",{className:"text-center py-16 text-muted-foreground",children:e.jsx("p",{children:"No blog posts found."})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:c.map(s=>{var o;return e.jsxs(d,{to:`/blog/${s.slug}`,className:"bg-card border border-border rounded-lg overflow-hidden group hover:border-primary/30 transition-colors",children:[s.featured_image_url&&e.jsx("div",{className:"aspect-video overflow-hidden",children:e.jsx("img",{src:s.featured_image_url,alt:s.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",width:800,height:450,loading:"lazy",decoding:"async"})}),e.jsxs("div",{className:"p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[((o=s.blog_categories)==null?void 0:o.name)&&e.jsx("span",{className:"text-xs text-primary",children:s.blog_categories.name}),s.published_at&&e.jsx("span",{className:"text-xs text-muted-foreground",children:u(new Date(s.published_at),"MMM d, yyyy")})]}),e.jsx("h2",{className:"font-display font-semibold mb-2 group-hover:text-primary transition-colors",children:s.title}),s.excerpt&&e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3",children:s.excerpt}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-3",children:["By ",s.author_name]})]})]},s.id)})})]}),e.jsx("div",{className:"hidden lg:block w-72 flex-shrink-0",children:e.jsx(N,{currentCategory:t})})]})]})})})}export{$ 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.