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