ChangeCard
uses tcmts.share.shareNow, which uses process
One change in a contribution (ChangeBox), with what reviewing it adds: "Viewed", its comments, and a form to
comment on it.
import { ChangeBox, CommentView, Fold, leafOf, Say, shareNow, ViewedToggle } from "#codebase/tcmts/share"; import type { ReviewItem } from "#codebase/tcmts/share"; import type { Comment, Contribution } from "#codebase/tcmts/store"; export function ChangeCard({ c, item, comments, }: { c: Contribution; item: ReviewItem; comments: Comment[]; }) { const s = shareNow(); return ( <ChangeBox item={item} extra={<ViewedToggle k={`${c.id}.${item.path}.${item.hash ?? item.old ?? ""}`} />} > {comments.map((k) => ( <CommentView key={k.id} k={k} /> ))} {c.status === "open" && s.caller.role !== "reader" && ( <div className="card-say"> <Fold head={<span className="muted">Comment on {leafOf(item.path)}</span>}> <Say c={c} about={[]} fixed={item.path} /> </Fold> </div> )} </ChangeBox> ); }
uses
- tcmts.share.ChangeBox
- tcmts.share.CommentView
- tcmts.share.Fold
- tcmts.share.ReviewItem
- tcmts.share.Say
- tcmts.share.ViewedToggle
- tcmts.share.leafOf
- tcmts.share.shareNow
- tcmts.store.Comment
- tcmts.store.Contribution