import React from "react"; import { CHART_EMPTY_HINT } from "@/lib/chartStats"; import type { SplitCounts } from "@/lib/dmsCatalog"; type Props = { counts: SplitCounts; height?: number }; const LABELS: { key: keyof SplitCounts; label: string }[] = [ { key: "train", label: "train" }, { key: "val", label: "val" }, { key: "test", label: "test" }, ]; export const SplitCountsBars: React.FC = ({ counts, height = 120 }) => { const total = counts.train + counts.val + counts.test; if (total <= 0) return

{CHART_EMPTY_HINT}

; const max = Math.max(counts.train, counts.val, counts.test, 1); const barW = 48; return (
{LABELS.map(({ key, label }) => { const n = counts[key]; return (
{n}
{label}
); })}
); };