import Link from 'next/link';
import { Section } from '@/components/ui/section';
import { Unavailable } from '@/components/ui/unavailable';
import { fmtInt, num, titleCase } from '@/lib/format';
import { ORBIT_CLASS_COLORS, routes } from '@/lib/site';
import type { HomePayload } from '@/lib/types';
interface RankRow {
key: string;
href: string;
label: string;
sub?: string | null;
value: number;
color?: string;
}
/** Ranked list with proportional bars where every label is a link (the shared HBars is not linkable). */
export function RankedBars({ rows, valueLabel }: { rows: RankRow[]; valueLabel: string }) {
if (!rows.length) return ;
const max = Math.max(1, ...rows.map((r) => r.value));
return (