Spaces:
Sleeping
Sleeping
File size: 864 Bytes
177c3f8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | "use client"
import * as React from "react"
import { cn } from "@/lib/utils"
interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
value?: number
}
const Progress = React.forwardRef<HTMLDivElement, ProgressProps>(
({ className, value = 0, ...props }, ref) => {
return (
<div
ref={ref}
role="progressbar"
aria-valuemin={0}
aria-valuemax={100}
aria-valuenow={value}
className={cn(
"relative h-2 w-full overflow-hidden rounded-full bg-primary/10",
className
)}
{...props}
>
<div
className="h-full w-full flex-1 bg-primary transition-all duration-300 ease-in-out"
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
/>
</div>
)
}
)
Progress.displayName = "Progress"
export { Progress }
|