import type { Quiz } from "@/lib/api"; export const KIND_LABEL: Record = { chapter: "Book chapter", lecture: "Lecture", conversation: "Conversation", standalone: "Stand-alone", }; /** "1m 12s" / "8.4s" — response times read better than raw milliseconds. */ export function fmtMs(ms: number | null | undefined): string { if (ms == null) return "—"; if (ms < 60_000) return `${(ms / 1000).toFixed(1)}s`; const m = Math.floor(ms / 60_000); const s = Math.round((ms % 60_000) / 1000); return `${m}m ${s}s`; }