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

2 lines
4.7 KiB
JavaScript

import{u as P,j as e,H as D}from"./vendor-BKmmeuxg.js";import{A as O,a as I,b as $}from"./avatar-j28afJTV.js";import{B as p}from"./badge-AQfLLMpR.js";import{S as l}from"./separator-_3LZ_wAA.js";import{L as z}from"./landing-layout-DQFYAk24.js";import{e as C}from"./richtor-CRcM6Du2.js";import E from"./blog-comments-D8HET_KS.js";import H from"./blog-like-dislike-BudO-7lX.js";import"./utils-DxSsnXxD.js";import"./index-WW_1X1qx.js";import"./index-CupQom6K.js";import"./app-logo-CmnEIwal.js";import"./button-BpNwv2aE.js";import"./main-_V386djS.js";import"./index-D9-QKOod.js";import"./dropdown-menu-DO-po5c1.js";import"./scroll-area-C8HGru-R.js";import"./use-auth-NG-DQJrC.js";import"./use-screen-DU5n3V8C.js";import"./appearance-D2z3xcjR.js";import"./app-BytVvUs_.js";/* empty css */import"./language-BFZ7KItL.js";import"./notification-CYMPYbAP.js";import"./popover-B4kBsMuI.js";import"./profile-toggle-CvHrFE0q.js";import"./index.browser-OxPLOBIU.js";import"./delete-modal-D1GJlb1P.js";import"./dialog-B2gN9MvT.js";import"./card-D9_SJYq6.js";import"./textarea-CyndvowL.js";const he=({blog:t})=>{var j,h,u,g,f,y,w,v;const{url:d,props:N}=P(),{translate:_}=N,{frontend:r}=_,k=new Date(t.created_at).toLocaleDateString(),A=(j=t.user)!=null&&j.name?t.user.name.split(" ").map(a=>a.charAt(0)).join("").toUpperCase():r.author_initials_fallback,x=t.banner||"/assets/images/blank-image.jpg",B=t.thumbnail||"/assets/images/blank-image.jpg",i=(t.keywords||"").split(",").map(a=>a.trim()).filter(Boolean),n=typeof window<"u"&&((h=window==null?void 0:window.App)==null?void 0:h.name)||r.default_site_name,o=d,S=typeof window<"u"?window.location.origin:d.split("/").slice(0,3).join("/"),L=`${t.title} | ${n}`,m=((u=t.description)==null?void 0:u.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim())||"",s=m.length>160?`${m.slice(0,157)}...`:m,c=x;return e.jsxs(z,{customizable:!1,children:[e.jsxs(D,{children:[e.jsx("title",{children:L}),s&&e.jsx("meta",{name:"description",content:s}),i.length>0&&e.jsx("meta",{name:"keywords",content:i.join(", ")}),e.jsx("meta",{property:"og:type",content:"article"}),e.jsx("meta",{property:"og:url",content:o}),e.jsx("meta",{property:"og:title",content:t.title}),s&&e.jsx("meta",{property:"og:description",content:s}),e.jsx("meta",{property:"og:site_name",content:n}),e.jsx("meta",{property:"og:image",content:c}),e.jsx("meta",{property:"og:image:width",content:"1200"}),e.jsx("meta",{property:"og:image:height",content:"630"}),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("meta",{name:"twitter:title",content:t.title}),s&&e.jsx("meta",{name:"twitter:description",content:s}),e.jsx("meta",{name:"twitter:image",content:c}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,description:s,image:c,url:o,mainEntityOfPage:o,datePublished:t.created_at,dateModified:t.updated_at,author:(g=t.user)!=null&&g.name?{"@type":"Person",name:t.user.name}:void 0,publisher:{"@type":"Organization",name:n,url:S},keywords:i.join(", ")})})]}),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:x,alt:r.blog_banner_alt,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:[((f=t.category)==null?void 0:f.name)&&e.jsx(p,{variant:"secondary",children:t.category.name}),i.slice(0,3).map(a=>e.jsx(p,{variant:"outline",children:a},a))]}),e.jsx("h1",{className:"text-2xl leading-tight font-semibold md:text-3xl",children:t.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(O,{className:"h-8 w-8",children:[e.jsx(I,{src:((y=t.user)==null?void 0:y.photo)||void 0,alt:((w=t.user)==null?void 0:w.name)||r.author_alt}),e.jsx($,{children:A})]}),e.jsx("span",{children:(v=t.user)==null?void 0:v.name})]}),e.jsx("span",{children:"•"}),e.jsx("span",{children:k})]})]}),e.jsx(l,{}),e.jsxs("div",{className:"space-y-6 px-6 pb-10",children:[e.jsxs("div",{children:[e.jsx("img",{src:B,alt:r.blog_thumbnail_alt,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(C,{value:t.description})})]}),i.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:i.map(a=>e.jsxs(p,{variant:"secondary",children:["#",a]},a))}),e.jsx(l,{className:"my-6"}),e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(H,{})}),e.jsx(l,{className:"my-6"}),e.jsx(E,{})]})]})]})};export{he as default};