import { VerificationBadge } from "yt-dlp-transcript-common/components/citations/VerificationBadge"; import { VerdictChip } from "yt-dlp-transcript-common/components/report/VerdictChip"; import { formatTimestamp } from "yt-dlp-transcript-common/lib/vtt"; import { CITATION_KIND_LABELS, spanLabel, type MomentPageView } from "yt-dlp-transcript-common/lib/report/views"; import { ExternalLinkText, Eyebrow, dateLabel, textLink } from "./parts"; // 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. export default function MomentArticle({ view }: { view: MomentPageView }) { const r = view.record; 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}

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