import { Progress } from "@/components/ui/progress"; type UsageMetric = { label: string; used: number; limit: number | null; unit?: string; unlimitedLabel: string; }; function UsageBar({ label, used, limit, unit, unlimitedLabel }: UsageMetric) { const pct = limit === null ? 0 : Math.min(100, (used / Math.max(limit, 1)) * 100); return (
{label} {used} {unit} / {limit === null ? unlimitedLabel : `${limit}${unit ?? ""}`}
{limit !== null && }
); } export function UsageQuotaSection({ metrics }: { metrics: UsageMetric[] }) { return (
{metrics.map((m) => ( ))}
); }