import{j as e}from"./react-vendor-xYZnmIII.js";import{g as t,A as h,h as j,i as v,j as u}from"./ui-components-CQM92IK3.js";import{P as f}from"./richtor-BECSBxkh.js";import"./inertia-vendor-cBbDTmhJ.js";import"./ui-vendor-Ds9iwIxa.js";import"./interactive-vendor-B1OgcAgP.js";const B=({blog:a})=>{var i,n,l,c,m;const d=new Date(a.created_at).toLocaleDateString(),x=(i=a.user)!=null&&i.name?a.user.name.split(" ").map(s=>s.charAt(0)).join("").toUpperCase():"AU",o=a.banner||"/assets/images/blank-image.jpg",p=a.thumbnail||"/assets/images/blank-image.jpg",r=(a.keywords||"").split(",").map(s=>s.trim()).filter(Boolean);return e.jsxs("div",{className:"mx-auto w-full max-w-4xl space-y-6",children:[e.jsx("div",{className:"overflow-hidden border",children:e.jsx("img",{src:o,alt:"Blog banner",className:"max-h-64 w-full object-cover sm:max-h-80 md:max-h-[420px]"})}),e.jsxs("div",{className:"space-y-3 px-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[((n=a.category)==null?void 0:n.name)&&e.jsx(t,{variant:"secondary",children:a.category.name}),r.slice(0,3).map(s=>e.jsx(t,{variant:"outline",children:s},s))]}),e.jsx("h1",{className:"text-2xl leading-tight font-semibold md:text-3xl",children:a.title}),e.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(h,{className:"h-8 w-8",children:[e.jsx(j,{src:((l=a.user)==null?void 0:l.photo)||void 0,alt:((c=a.user)==null?void 0:c.name)||"Author"}),e.jsx(v,{children:x})]}),e.jsx("span",{children:(m=a.user)==null?void 0:m.name})]}),e.jsx("span",{children:"•"}),e.jsx("span",{children:d})]})]}),e.jsx(u,{}),e.jsxs("div",{className:"space-y-6 px-6 pb-10",children:[e.jsxs("div",{children:[e.jsx("img",{src:p,alt:"Blog thumbnail",className:"max-h-60 w-full overflow-hidden rounded-lg border object-cover sm:max-h-72 md:max-h-96"}),e.jsx("div",{className:"prose dark:prose-invert max-w-none py-6",children:e.jsx(f,{value:a.description})})]}),r.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:r.map(s=>e.jsxs(t,{variant:"secondary",children:["#",s]},s))})]})]})};export{B as default};
