import * as React from 'react' import * as ProgressPrimitive from '@radix-ui/react-progress' import { cva, type VariantProps } from 'class-variance-authority' import { cn } from '../../utils/cn' const progressVariants = cva( 'h-full w-full flex-1 transition-all duration-normal', { variants: { variant: { default: 'bg-brand-500', success: 'bg-success', warning: 'bg-warning', error: 'bg-error', }, }, defaultVariants: { variant: 'default', }, } ) export interface ProgressProps extends React.ComponentPropsWithoutRef, VariantProps { showValue?: boolean } const Progress = React.forwardRef< React.ElementRef, ProgressProps >(({ className, value, variant, showValue = false, ...props }, ref) => (
{showValue && ( {Math.round(value || 0)}% )}
)) Progress.displayName = ProgressPrimitive.Root.displayName export { Progress }