// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0-or-later
// @source: https://gitlab.com/soapbox-pub/ditto/-/tree/f0a3877c
import{Wr as e}from"./lucide-icons-BdRF0moN.js";import{t}from"./jsx-runtime-By8HlURe.js";import{wt as n}from"./EmbeddedNote-BKfkvcrg.js";import{n as r}from"./articleHelpers-Dhr_Z8YP.js";import{r as i,t as a}from"./lib-D6JeXc-v.js";import{t as o}from"./articleSmartypants-Bcj3a4SM.js";import{t as s}from"./markdownComponents-BiuuXc15.js";var c=t();function l(e,t){return e.find(([e])=>e===t)?.[1]}function u({event:t,preview:u,className:d}){let f=l(t.tags,`title`),p=l(t.tags,`summary`),m=l(t.tags,`image`),h=t.tags.filter(([e])=>e===`t`).map(([,e])=>e),g=r(t.content);if(u)return(0,c.jsxs)(`div`,{className:d,children:[f&&(0,c.jsx)(`h3`,{dir:`auto`,className:`text-base font-bold leading-snug`,children:f}),m&&(0,c.jsx)(`img`,{src:m,alt:f??`Article image`,className:`w-full rounded-lg object-cover max-h-64 mt-2`,decoding:`async`}),p?(0,c.jsx)(`p`,{dir:`auto`,className:`text-[15px] leading-relaxed line-clamp-3 mt-2`,children:p}):(0,c.jsxs)(`p`,{dir:`auto`,className:`text-[15px] leading-relaxed line-clamp-3 mt-2`,children:[t.content.slice(0,280),t.content.length>280?`...`:``]}),(0,c.jsxs)(`div`,{className:`flex items-center gap-2 mt-2`,children:[(0,c.jsx)(`span`,{className:`inline-block text-xs font-medium text-primary`,children:`Read article`}),g&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`span`,{className:`text-xs text-muted-foreground`,"aria-hidden":`true`,children:`·`}),(0,c.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,c.jsx)(e,{className:`size-3 shrink-0`,"aria-hidden":`true`}),g]})]})]})]});let _=s(t);return(0,c.jsxs)(`div`,{className:d,children:[f&&(0,c.jsx)(`h1`,{dir:`auto`,className:`text-2xl font-bold leading-tight mb-4`,children:f}),g&&(0,c.jsxs)(`p`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground -mt-2 mb-4`,children:[(0,c.jsx)(e,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),g]}),m&&(0,c.jsx)(`img`,{src:m,alt:f??`Article image`,className:`w-full rounded-xl object-cover max-h-96 mb-6`,decoding:`async`}),(0,c.jsx)(`div`,{dir:`auto`,...n(t),className:`prose prose-sm max-w-none break-words text-foreground prose-headings:text-foreground prose-headings:font-bold prose-strong:text-foreground prose-a:text-primary prose-a:no-underline hover:prose-a:underline prose-img:rounded-lg prose-pre:overflow-x-auto prose-pre:rounded-lg prose-pre:bg-muted prose-pre:text-foreground prose-code:text-[13px] prose-code:text-foreground prose-code:before:content-none prose-code:after:content-none prose-code:bg-muted prose-code:rounded prose-code:px-1.5 prose-code:py-0.5 prose-code:font-normal prose-li:marker:text-muted-foreground prose-blockquote:text-muted-foreground prose-blockquote:border-border prose-hr:border-border prose-th:text-foreground`,children:(0,c.jsx)(i,{remarkPlugins:[o],rehypePlugins:[a],components:_,children:t.content})}),h.length>0&&(0,c.jsx)(`div`,{className:`flex flex-wrap gap-2 mt-6 pt-4 border-t border-border`,children:h.map(e=>(0,c.jsxs)(`a`,{href:`/t/${encodeURIComponent(e)}`,className:`text-sm text-primary hover:underline`,children:[`#`,e]},e))})]})}export{u as ArticleContent};
// @license-end
