import{j as e,V as j,$ as f,I as v,r as m,g as N,h as C,S as I,m as g,av as w,s as p,L as A,y as k}from"./index-DTnfwphX.js";import{u as B,a as L,B as u}from"./BlogCard-UVMlEWmf.js";import"./analytics-Bu8LxldC.js";import"./useQuery-CfspJQJP.js";import"./date-utils-BcQETFuH.js";const P=()=>e.jsxs(e.Fragment,{children:[e.jsxs(j,{children:[e.jsx("title",{children:"Blog | Cendra AI - Insights for Hospitality"}),e.jsx("meta",{name:"description",content:"Discover the latest insights on AI in hospitality, guest experience optimization, and property management automation from Cendra AI."}),e.jsx("meta",{property:"og:title",content:"Blog | Cendra AI - Insights for Hospitality"}),e.jsx("meta",{property:"og:description",content:"Discover the latest insights on AI in hospitality, guest experience optimization, and property management automation from Cendra AI."}),e.jsx("meta",{property:"og:type",content:"website"}),e.jsx("link",{rel:"canonical",href:"https://cendra.ai/blog"})]}),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:"Insights & Resources"}),e.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold text-foreground mb-6",children:"The Cendra Blog"}),e.jsx("p",{className:"text-lg md:text-xl text-muted-foreground max-w-2xl mx-auto",children:"Expert insights on AI-powered guest communication, hospitality automation, and strategies to elevate your property management."})]})})]}),S=({categories:r,activeCategory:o,onCategoryChange:t,searchQuery:i,onSearchChange:l})=>e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"relative max-w-md mx-auto",children:[e.jsx(f,{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:i,onChange:a=>l(a.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:()=>t("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"}),r.map(a=>e.jsx("button",{onClick:()=>t(a.slug),className:`px-4 py-2 rounded-full text-sm font-medium transition-all ${o===a.slug?"bg-primary text-primary-foreground":"bg-secondary text-secondary-foreground hover:bg-secondary/80"}`,children:a.name},a.id))]})]}),T=()=>{const[r,o]=m.useState("all"),[t,i]=m.useState("");N({pageName:"blog"}),C({pageName:"blog"});const{data:l=[],isLoading:a}=B(),{data:c=[],isLoading:h}=L(r),n=m.useMemo(()=>{if(!t.trim())return c;const s=t.toLowerCase();return c.filter(d=>d.title.toLowerCase().includes(s)||d.excerpt?.toLowerCase().includes(s)||d.content.toLowerCase().includes(s))},[c,t]),x=n[0],y=n.slice(1),b=a||h;return e.jsxs(e.Fragment,{children:[e.jsx(I,{title:"Blog | Cendra AI - Hospitality AI Insights & Best Practices",description:"Discover hospitality AI insights, vacation rental tips, and guest communication best practices. Learn how to automate and grow your property business.",ogTitle:"Blog | Cendra AI - Hospitality AI Insights",ogDescription:"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(P,{}),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(S,{categories:l,activeCategory:r,onCategoryChange:s=>{o(s),g("blog_category_filter",s)},searchQuery:t,onSearchChange:i})})}),e.jsx("section",{className:"py-12 md:py-16",children:e.jsx("div",{className:"max-w-6xl mx-auto px-6",children:b?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(w,{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:t?"No articles found matching your search.":"No articles published yet."}),t&&e.jsx(p,{variant:"outline",onClick:()=>i(""),children:"Clear search"})]}):e.jsxs("div",{className:"space-y-12",children:[x&&r==="all"&&!t&&e.jsx("div",{className:"mb-12",children:e.jsx(u,{post:x,featured:!0})}),e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:(r==="all"&&!t?y:n).map(s=>e.jsx(u,{post:s},s.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:"Ready to transform your guest communication?"}),e.jsx("p",{className:"text-muted-foreground mb-8",children:"Join hundreds of hospitality operators already using Cendra AI to automate guest messages and boost revenue."}),e.jsx(A,{to:"/pricing-new",children:e.jsx(p,{size:"lg",className:"bg-primary hover:bg-primary-hover text-primary-foreground",onClick:()=>g("blog_cta","view_pricing"),children:"View Pricing"})})]})}),e.jsx(k,{})]})]})};export{T as default};