import { badgeVariants, type BadgeVariants } from "@/components/ui/badge"; import type { readClipDetail } from "@/lib/projects/report.mjs"; import type { Severity } from "@/lib/decisions"; import type { ProjectRef } from "@/lib/project-types"; // What every tab of a report video's piece page shares: the project, its // parsed detail (the one expensive read, done once by the page), and the // small helpers the sections were written with. export type ClipDetail = NonNullable>>; export type ReportTabProps = { project: ProjectRef; detail: ClipDetail; search: Record; /** * The address of one of the piece's tabs: the project's own page, or -- when * an article claims the project (P4a-2) -- the article piece's. Absent is the * project's (lib/hrefs projectHref). */ tabHref?: (tab: string, q?: { all?: boolean }) => string; }; export const hms = (t: number) => { const s = Math.max(0, Math.floor(t)); const h = Math.floor(s / 3600); const m = Math.floor((s % 3600) / 60); const sec = s % 60; return h > 0 ? `${h}:${String(m).padStart(2, "0")}:${String(sec).padStart(2, "0")}` : `${m}:${String(sec).padStart(2, "0")}`; }; export const TONE: Record = { blocking: "blocking", open: "state", info: "info", }; export function Pill({ tone, children }: { tone?: BadgeVariants["variant"]; children: React.ReactNode }) { return {children}; }