import * as React from 'react' import { cn } from '@/lib/utils' interface ProgressProps extends React.HTMLAttributes { value?: number max?: number showLabel?: boolean } const Progress = React.forwardRef( ({ className, value = 0, max = 100, showLabel = false, ...props }, ref) => { const percentage = Math.min(100, Math.max(0, (value / max) * 100)) return (
{showLabel && ( {Math.round(percentage)}% )}
) } ) Progress.displayName = 'Progress' export { Progress }