lms/public/build/assets/preview-DQi3mhA_.js
2025-12-15 12:26:23 +01:00

2 lines
2.1 KiB
JavaScript

import{j as e}from"./vendor-BKmmeuxg.js";import{A as h,a as j,b as v}from"./avatar-j28afJTV.js";import{B as t}from"./badge-AQfLLMpR.js";import{S as u}from"./separator-_3LZ_wAA.js";import{e as f}from"./richtor-CRcM6Du2.js";import"./utils-DxSsnXxD.js";import"./index-WW_1X1qx.js";const b=({blog:a})=>{var i,n,m,l,c;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:((m=a.user)==null?void 0:m.photo)||void 0,alt:((l=a.user)==null?void 0:l.name)||"Author"}),e.jsx(v,{children:x})]}),e.jsx("span",{children:(c=a.user)==null?void 0:c.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};