Openstatus
www.openstatus.dev
1"use client";
2
3import * as ProgressPrimitive from "@radix-ui/react-progress";
4import * as React from "react";
5
6import { cn } from "@/lib/utils";
7
8const Progress = React.forwardRef<
9 React.ElementRef<typeof ProgressPrimitive.Root>,
10 React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
11>(({ className, value, ...props }, ref) => (
12 <ProgressPrimitive.Root
13 ref={ref}
14 className={cn(
15 "bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
16 className,
17 )}
18 {...props}
19 >
20 <ProgressPrimitive.Indicator
21 className="bg-primary h-full w-full flex-1 transition-all"
22 style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
23 />
24 </ProgressPrimitive.Root>
25));
26Progress.displayName = ProgressPrimitive.Root.displayName;
27
28export { Progress };