// @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{Qr as e}from"./lucide-icons-BdRF0moN.js";import{t}from"./jsx-runtime-By8HlURe.js";import{l as n}from"./EmbeddedNote-BKfkvcrg.js";import{a as r}from"./appRelays-Clm5NPIe.js";import{n as i}from"./safeNip19-CtQLwPmS.js";import{f as a,u as o}from"./useEventInteractions-Buyvdv_T.js";import{t as s}from"./GitSiteLinks-CnSU1vGl.js";import{r as c,t as l}from"./lib-D6JeXc-v.js";import{t as u}from"./markdownComponents-BiuuXc15.js";var d=t();function f({event:t,preview:f=!0}){let p=o(t)?.identifier??``,m=t.tags.find(([e])=>e===`subject`)?.[1]?.trim(),h=a(t)??`Issue`,g=t.tags.filter(([e])=>e===`t`).map(([,e])=>e),_=m?t.content.trim():t.content.split(` `).slice(1).join(` `).trim(),v=i({id:t.id,author:t.pubkey,relays:[r]});return(0,d.jsxs)(`div`,{className:`mt-2 space-y-3`,children:[(0,d.jsx)(`div`,{className:`rounded-2xl border border-border overflow-hidden`,children:(0,d.jsxs)(`div`,{className:`px-3.5 py-3 space-y-2`,children:[(0,d.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,d.jsx)(e,{className:`size-4 text-green-600 dark:text-green-400 shrink-0 mt-0.5`}),(0,d.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,d.jsx)(`span`,{className:`font-semibold text-sm leading-snug line-clamp-2`,children:h}),p&&(0,d.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5 font-mono`,children:p})]})]}),g.length>0&&(0,d.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[g.slice(0,f?6:g.length).map(e=>(0,d.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[`#`,e]},e)),f&&g.length>6&&(0,d.jsxs)(`span`,{className:`text-[11px] text-muted-foreground/50`,children:[`+`,g.length-6,` more`]})]}),f&&_&&(0,d.jsx)(`div`,{className:`text-[13px] text-muted-foreground line-clamp-3 leading-relaxed whitespace-pre-wrap break-words`,children:(0,d.jsx)(n,{event:{...t,content:_},as:`span`,disableNoteEmbeds:!0,disableMediaEmbeds:!0})}),(0,d.jsx)(s,{nip19:v,className:`pt-0.5`})]})}),!f&&_&&(0,d.jsx)(`div`,{className:`rounded-2xl border border-border overflow-hidden px-4 py-4 sidebar:px-5 sidebar:py-5`,children:(0,d.jsx)(`div`,{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-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,d.jsx)(c,{rehypePlugins:[l],components:u(t),children:_})})})]})}export{f as IssueCard}; // @license-end