import { cn } from "@/lib/utils"; function num(v: number | string | null | undefined): number | null { if (v == null || v === "") return null; const n = typeof v === "string" ? Number(v) : v; return Number.isFinite(n) ? n : null; } function pct(v: number | string | null | undefined): number { const n = num(v); if (n == null) return 0; return Math.max(0, Math.min(5, n)) / 5 * 100; } export function MiniBars({ usefulness, usability, className, }: { usefulness: number | string | null | undefined; usability: number | string | null | undefined; className?: string; }) { const rows = [ { label: "Usefulness", value: usefulness }, { label: "Usability", value: usability }, ]; return (