import * as React from "react"; import { cn } from "@/lib/utils"; /** * Linear meter for quota-style values (used vs limit). Color only turns to warning/danger when * the threshold is actually crossed; the label always carries the numbers. */ export function QuotaBar({ label, used, limit, usedLabel, limitLabel, unlimited, hint, className, }: { label: React.ReactNode; used: number; limit: number | null; usedLabel: string; limitLabel?: string; unlimited?: boolean; hint?: React.ReactNode; className?: string; }) { const pct = unlimited || !limit || limit <= 0 ? 0 : Math.min(100, (used / limit) * 100); const tone = pct >= 100 ? "bg-danger" : pct >= 80 ? "bg-warning" : "bg-accent"; return (