import { CheckIcon, XIcon } from "lucide-react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import type { QualityResult } from "@/lib/db/schema"; import { SECTION_HINT, SECTION_LABEL } from "@/lib/quality-view"; import { cn } from "@/lib/utils"; /** A quality eval's result: the score, each section's pass rate and every item. */ export function QualityReport({ quality, running }: { quality: QualityResult | null; running: boolean }) { if (!quality) { return ( {running ? "The quality eval is running; results appear when it's done." : "No result."} ); } return ( Quality Eval set {quality.evalSet}: greedy decoding (temperature {quality.config.temperature}, seed {quality.config.seed}), thinking{" "} {quality.config.thinking ? "on" : "off"} {quality.config.contextTokens ? `, context ${quality.config.contextTokens.toLocaleString("en-US")} tokens` : ""}. Scores are the share of items that pass; only results of the same eval set compare.
{quality.score != null ? `${quality.score}%` : "—"} overall (mean of the sections)
Section Passed Score Time {quality.sections.map((s) => (
{SECTION_LABEL[s.section]}
{s.unsupported ? `Not counted: ${s.unsupported}` : SECTION_HINT[s.section]}
{s.unsupported ? "—" : `${s.passed} / ${s.total}`} {s.score != null ? `${s.score}%` : "—"} {s.seconds} s
))}
); }