CommentView
uses tcmts.share.shareNow, which uses process
A comment, or an event told as one.
import { ago, Avatar, Html, isEvent, markdownHtml, shareNow } from "#codebase/tcmts/share"; import type { Comment } from "#codebase/tcmts/store"; export function CommentView({ k }: { k: Comment }) { const s = shareNow(); if (isEvent(k)) return ( <div className="event"> <Avatar name={k.author} /> <b>{k.author}</b> {/^(closed|reopened)$/.test(k.body) ? `${k.body} this` : k.body} · {ago(k.ts)} </div> ); return ( <div className="comment"> <div className="ch"> <Avatar name={k.author} /> <b>{k.author}</b> {k.about && ( <> {" "} on{" "} <a className="mono" href={`#d-${k.about}`}> {k.about} </a> </> )}{" "} · {ago(k.ts)} </div> <Html className="cb md" html={markdownHtml(s.cb, k.body)} /> </div> ); }
uses
- tcmts.share.Avatar
- tcmts.share.Html
- tcmts.share.ago
- tcmts.share.isEvent
- tcmts.share.markdownHtml
- tcmts.share.shareNow
- tcmts.store.Comment