import type { HTMLAttributes } from 'react' import { cn } from '../../utils/cn' type ProgressProps = HTMLAttributes & { value?: number max?: number indeterminate?: boolean label?: string } export function Progress({ value = 0, max = 100, indeterminate = false, label, className, ...props }: ProgressProps) { const percentage = Math.min(Math.max(Math.round((value / max) * 100), 0), 100) return ( {(label || !indeterminate) && ( {label && {label}} {!indeterminate && {percentage}%} )} ) }