| 6 | import { cn } from "../lib/utils"; |
| 7 | |
| 8 | function Progress({ |
| 9 | className, |
| 10 | value, |
| 11 | ...props |
| 12 | }: React.ComponentProps<typeof ProgressPrimitive.Root>) { |
| 13 | return ( |
| 14 | <ProgressPrimitive.Root |
| 15 | data-slot="progress" |
| 16 | className={cn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", className)} |
| 17 | {...props} |
| 18 | > |
| 19 | <ProgressPrimitive.Indicator |
| 20 | data-slot="progress-indicator" |
| 21 | className="h-full w-full flex-1 bg-primary transition-all" |
| 22 | style={{ transform: `translateX(-${100 - (value || 0)}%)` }} |
| 23 | /> |
| 24 | </ProgressPrimitive.Root> |
| 25 | ); |
| 26 | } |
| 27 | |
| 28 | export { Progress }; |