"use client" import Link from "next/link" import { ArrowUpRight, ChevronDown, ChevronUp, ChevronsUpDown } from "lucide-react" import { VerifiedBadge } from "@/components/signals/verified-badge" import { isRecognizedEvaluator, type EvaluatorGroup } from "@/lib/evaluators" import { cn } from "@/lib/utils" export type EvaluatorTableSortCol = "name" | "evals" | "verified" interface EvaluatorTableProps { rows: EvaluatorGroup[] sortCol: EvaluatorTableSortCol sortDir: "asc" | "desc" onSort: (col: EvaluatorTableSortCol) => void /** When true, the verified filter is active — propagate it into the link. */ verifiedOnly?: boolean } export function EvaluatorTable({ rows, sortCol, sortDir, onSort, verifiedOnly }: EvaluatorTableProps) { function SortIcon({ col }: { col: EvaluatorTableSortCol }) { if (sortCol !== col) return return sortDir === "asc" ? : } function SortTh({ col, children, className, style, }: { col: EvaluatorTableSortCol children: React.ReactNode className?: string style?: React.CSSProperties }) { const active = sortCol === col return ( onSort(col)} > {children} ) } // The detail route always shows the org's full profile — the verified-only // list filter is intentionally not carried across (it changed nothing for // grey/recognized orgs and only narrowed blue mixed orgs, while the detail // header already reports total + verified counts side by side). const hrefFor = (slug: string) => `/evaluators/${slug}` return (
EvaluatorEvaluations reported {/* In verified-only mode every (eval, org) membership is already verified, so verifiedCount === evalCount for every row — the two columns are identical. Drop the redundant Verified column there and keep it only when the counts can differ. */} {!verifiedOnly && Verified} {rows.map((row) => ( {!verifiedOnly && ( )} ))}
{row.name}
{verifiedOnly ? ( {row.evalCount.toLocaleString()} ) : ( row.evalCount.toLocaleString() )} {row.verifiedCount > 0 ? ( {row.verifiedCount.toLocaleString()} ) : ( )} Open
) }