import { cn } from "@/lib/utils"; export interface ProgressProps { /** 0 to 100. Omitted, the bar runs indeterminate. */ value?: number; /** Shows the percentage above the bar. Ignored when indeterminate. Default false. */ showValue?: boolean; className?: string; } /** A progress bar that fills with scale, not width, so it stays cheap to animate. */ export function Progress({ value, showValue = false, className }: ProgressProps) { const clamped = value === undefined ? undefined : Math.min(100, Math.max(0, value)); return (
{showValue && clamped !== undefined ? ( {Math.round(clamped)}% ) : null}
); }