CommentView

tcmts.share.CommentView · #vsfxsyko · term · runs on the server

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

used by