import { Link } from '#/components/atoms/link.jsx'; import { KIND_META, KIND_ORDER } from '#/lib/file-kinds.js'; import { bytes, num } from '#/lib/format.js'; import { cn } from '#/lib/utils.js'; /** * Storage by kind as one proportional bar. Segments keep the fixed kind order * and hues; a 2px gap of card surface separates them. Clicking a segment is * the same act as its chip: filter to that kind. */ export function StorageBar({ facets, filters, hrefFor, onNavigate }) { const present = KIND_ORDER.map((kind) => facets.kinds.find((facet) => facet.kind === kind), ).filter(Boolean); if (!present.length) return null; const summary = present .map((f) => `${KIND_META[f.kind].label} ${bytes(f.bytes)}`) .join(', '); return (
{present.map((facet) => ( ))}
); }