import { VerificationBadge } from "../citations/VerificationBadge"; import { VerdictChip } from "./VerdictChip"; import { formatTimestamp } from "../../lib/vtt"; import { CITATION_KIND_LABELS, spanLabel, type MomentPageView, type RecordView } from "../../lib/report/views"; import { ExternalLinkText, Eyebrow, dateLabel, textLink } from "./parts"; import { SOURCE_GONE_LABELS } from "../../lib/sourceGone"; import { PageCaptureFacts } from "../PageCaptureFacts"; // ONE CITED MOMENT, from its view (common/lib/report/views.ts): a span's // self-hosted evidence clip (video, or audio with its poster) or a post's // captured shot and text; the quote and what checking it found; the transcript // lines around the span; the record's metadata and a link to the original at // its time (and into the corpus on a full site); and every place on the site // that cites it. // // "Open in the archive" is the corpus link resolver's: by default the view's // own `corpusUrl` (compose resolved it into the site's own corpus); a build // that links elsewhere — or nowhere — passes `corpusHref`. // The corpus link of a moment's record: a URL, or undefined for none. export type CorpusHrefResolver = (record: RecordView, view: MomentPageView) => string | undefined; const viewCorpusHref: CorpusHrefResolver = (record) => record.corpusUrl; export default function MomentArticle({ view, corpusHref = viewCorpusHref, }: { view: MomentPageView; corpusHref?: CorpusHrefResolver; }) { const r = view.record; const corpusUrl = corpusHref(r, view); const isSpan = view.kind === "video" || view.kind === "audio"; const span = isSpan && view.start !== undefined && view.end !== undefined ? spanLabel(view.start, view.end) : null; const meta = [r.channelTitle ?? r.channel, dateLabel(view.date ?? r.date), span].filter(Boolean).join(" · "); const title = r.title ?? (view.kind === "post" ? (view.post?.author ?? r.channelTitle ?? r.channel) : `${r.channel}/${r.id}`); const clip = view.clip; const padded = clip && view.start !== undefined && view.end !== undefined && (clip.start < view.start || clip.end > view.end); return (
Cited {CITATION_KIND_LABELS[view.kind].toLowerCase()}

{title}

{meta &&

{meta}

}
{view.sourceGone && ( // The source is gone and no copy of the moment is published: its words // only (release 29 E2).

{SOURCE_GONE_LABELS[view.sourceGone]}

)} {clip && view.kind === "video" && (
); }