import { AlertTriangle, Briefcase, CheckCircle2, GraduationCap, Languages, Play, ShieldAlert, ShieldCheck, Video } from "lucide-react"; import { useEffect, useState } from "react"; import { Area, AreaChart, CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts"; import { api, type CameraInfo, type CvProfile, type EmotionProbs, type Integrity, type Report, type SkillMatch } from "../lib/api"; import { useI18n } from "../lib/i18n"; import { fmtClock } from "../lib/media"; import { Badge, Meter, Panel } from "./ui"; export const EMO_ORDER: (keyof EmotionProbs)[] = ["neutral", "happy", "surprised", "sad", "angry", "fearful", "disgusted"]; export const EMO_COLOR: Record = { neutral: "#8FA3A0", happy: "var(--color-nile)", surprised: "var(--color-amber)", sad: "#5B7DB1", angry: "var(--color-danger)", fearful: "#8E6BB8", disgusted: "#9A7B4F", }; const tip = { background: "var(--color-surface)", border: "1px solid var(--color-line)", borderRadius: 12, color: "var(--color-ink)" }; const pct = (v: number | null | undefined) => `${Math.round((v ?? 0) * 100)}%`; /** Plays an answer recording; video answers get a video player. */ export function AnswerMedia({ sid, idx, video }: { sid: string; idx: number; video?: boolean }) { const { t } = useI18n(); const [url, setUrl] = useState(null); const [busy, setBusy] = useState(false); useEffect(() => () => { if (url) URL.revokeObjectURL(url); }, [url]); if (url) return video ?