import{u as h,j as e,a3 as N,n as v,r as m,s as C,v as w,z as k,m as x,aC as B,B as u,W as L,K as A}from"./index-AIIMweKF.js";import{u as I,a as P,B as p}from"./BlogCard-33l1oHtZ.js";import"./analytics-CNjZOon8.js";import"./useQuery-6z3xwoF_.js";import"./date-utils-BcQETFuH.js";const S=()=>{const{t}=h("common");return e.jsx("section",{className:"relative bg-gradient-to-b from-primary/5 to-background py-16 md:py-24",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-6 text-center",children:[e.jsx("span",{className:"inline-block px-3 py-1 text-xs font-medium text-primary bg-primary/10 rounded-full mb-4",children:t("blog.hero.badge","Insights & Resources")}),e.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold text-foreground mb-6",children:t("blog.hero.title","The Cendra Blog")}),e.jsx("p",{className:"text-lg md:text-xl text-muted-foreground max-w-2xl mx-auto",children:t("blog.hero.description","Expert insights on AI-powered guest communication, hospitality automation, and strategies to elevate your property management.")})]})})},T=({categories:t,activeCategory:o,onCategoryChange:i,searchQuery:s,onSearchChange:l})=>e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"relative max-w-md mx-auto",children:[e.jsx(N,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(v,{type:"text",placeholder:"Search articles...",value:s,onChange:r=>l(r.target.value),className:"pl-10 bg-card border-border"})]}),e.jsxs("div",{className:"flex flex-wrap justify-center gap-2",children:[e.jsx("button",{onClick:()=>i("all"),className:`px-4 py-2 rounded-full text-sm font-medium transition-all ${o==="all"?"bg-primary text-primary-foreground":"bg-secondary text-secondary-foreground hover:bg-secondary/80"}`,children:"All Posts"}),t.map(r=>e.jsx("button",{onClick:()=>i(r.slug),className:`px-4 py-2 rounded-full text-sm font-medium transition-all ${o===r.slug?"bg-primary text-primary-foreground":"bg-secondary text-secondary-foreground hover:bg-secondary/80"}`,children:r.name},r.id))]})]}),_=()=>{const{t}=h("common"),[o,i]=m.useState("all"),[s,l]=m.useState("");C({pageName:"blog"}),w({pageName:"blog"});const{data:r=[],isLoading:b}=I(),{data:c=[],isLoading:y}=P(o),n=m.useMemo(()=>{if(!s.trim())return c;const a=s.toLowerCase();return c.filter(d=>d.title.toLowerCase().includes(a)||d.excerpt?.toLowerCase().includes(a)||d.content.toLowerCase().includes(a))},[c,s]),g=n[0],j=n.slice(1),f=b||y;return e.jsxs(e.Fragment,{children:[e.jsx(k,{title:t("blog.meta.title","Blog | Cendra AI - Hospitality AI Insights & Best Practices"),description:t("blog.meta.description","Discover hospitality AI insights, vacation rental tips, and guest communication best practices. Learn how to automate and grow your property business."),ogTitle:t("blog.meta.ogTitle","Blog | Cendra AI - Hospitality AI Insights"),ogDescription:t("blog.meta.description","Discover hospitality AI insights, vacation rental tips, and guest communication best practices."),canonicalPath:"/blog"}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(S,{}),e.jsx("section",{className:"py-8 border-b border-border sticky top-16 bg-background/95 backdrop-blur-sm z-40",children:e.jsx("div",{className:"max-w-6xl mx-auto px-6",children:e.jsx(T,{categories:r,activeCategory:o,onCategoryChange:a=>{i(a),x("blog_category_filter",a)},searchQuery:s,onSearchChange:l})})}),e.jsx("section",{className:"py-12 md:py-16",children:e.jsx("div",{className:"max-w-6xl mx-auto px-6",children:f?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(B,{className:"h-8 w-8 animate-spin text-primary"})}):n.length===0?e.jsxs("div",{className:"text-center py-20",children:[e.jsx("p",{className:"text-xl text-muted-foreground mb-4",children:s?t("blog.empty.noResults","No articles found matching your search."):t("blog.empty.noArticles","No articles published yet.")}),s&&e.jsx(u,{variant:"outline",onClick:()=>l(""),children:t("blog.empty.clearSearch","Clear search")})]}):e.jsxs("div",{className:"space-y-12",children:[g&&o==="all"&&!s&&e.jsx("div",{className:"mb-12",children:e.jsx(p,{post:g,featured:!0})}),e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:(o==="all"&&!s?j:n).map(a=>e.jsx(p,{post:a},a.id))})]})})}),e.jsx("section",{className:"py-16 bg-primary/5",children:e.jsxs("div",{className:"max-w-3xl mx-auto px-6 text-center",children:[e.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-foreground mb-4",children:t("blog.cta.title","Ready to transform your guest communication?")}),e.jsx("p",{className:"text-muted-foreground mb-8",children:t("blog.cta.description","Join hundreds of hospitality operators already using Cendra AI to automate guest messages and boost revenue.")}),e.jsx(L,{to:"/pricing",children:e.jsx(u,{size:"lg",className:"bg-primary hover:bg-primary-hover text-primary-foreground",onClick:()=>x("blog_cta","view_pricing"),children:t("blog.cta.button","View Pricing")})})]})}),e.jsx(A,{})]})]})};export{_ as default};