"use client" import { ArrowUpRight } from "lucide-react" import { cn } from "@/lib/utils" import type { CategoryType } from "@/lib/benchmark-schema" export interface EvalNodeTableRow { id: string title: string kind: string kindLabel: string category: CategoryType familyLabel?: string suiteLabel?: string description: string modelsCount: number metricCount: number childCount: number isNavigable: boolean actionLabel: string domains: string[] completenessScore?: number } interface EvalNodeTableProps { rows: EvalNodeTableRow[] onOpen: (id: string) => void } const CATEGORY_DOT: Record = { General: "bg-sky-400", Reasoning: "bg-violet-400", Agentic: "bg-amber-400", Safety: "bg-rose-400", Code: "bg-emerald-400", Math: "bg-indigo-400", Multilingual: "bg-teal-400", } export function EvalNodeTable({ rows, onOpen }: EvalNodeTableProps) { return (
{rows.map((row) => { const completenessPct = row.completenessScore != null ? Math.round(row.completenessScore * 100) : null const dotClass = CATEGORY_DOT[row.category] ?? "bg-stone-400" return ( row.isNavigable && onOpen(row.id)} style={{ cursor: row.isNavigable ? "pointer" : "default" }} aria-disabled={!row.isNavigable} > ) })}
Node Lineage Kind Children Models Metrics Completeness
{row.title}
{row.description && (
{row.description}
)}
{row.familyLabel && (
{row.familyLabel}
)} {row.suiteLabel && (
{row.suiteLabel}
)} {!row.familyLabel && !row.suiteLabel && ( )}
{row.kindLabel} {row.childCount > 0 ? row.childCount.toLocaleString() : "—"} {row.modelsCount.toLocaleString()} {row.metricCount.toLocaleString()} {completenessPct != null ? (
{completenessPct}%
) : ( )}
{row.isNavigable && ( Open )}
) }