gitscope
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/common/components/ui/progress.tsx · v0.6.4
Source
1 3b7feef Mrdn 2y ago import * as React from "react"
2 3b7feef Mrdn 2y ago import * as ProgressPrimitive from "@radix-ui/react-progress"
3 3b7feef Mrdn 2y ago
4 d636f3f Dawsh 2y ago import { cn } from "@marzneshin/common/utils"
5 3b7feef Mrdn 2y ago
6 3b7feef Mrdn 2y ago const Progress = React.forwardRef<
7 d636f3f Dawsh 2y ago React.ElementRef<typeof ProgressPrimitive.Root>,
8 d636f3f Dawsh 2y ago React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
9 3b7feef Mrdn 2y ago >(({ className, value, ...props }, ref) => (
10 d636f3f Dawsh 2y ago <ProgressPrimitive.Root
11 d636f3f Dawsh 2y ago ref={ref}
12 d636f3f Dawsh 2y ago className={cn(
13 d636f3f Dawsh 2y ago "relative h-4 w-full overflow-hidden rounded-full bg-secondary",
14 d636f3f Dawsh 2y ago className
15 d636f3f Dawsh 2y ago )}
16 d636f3f Dawsh 2y ago {...props}
17 d636f3f Dawsh 2y ago >
18 d636f3f Dawsh 2y ago <ProgressPrimitive.Indicator
19 d636f3f Dawsh 2y ago className="h-full w-full flex-1 bg-primary transition-all"
20 d636f3f Dawsh 2y ago style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
21 d636f3f Dawsh 2y ago />
22 d636f3f Dawsh 2y ago </ProgressPrimitive.Root>
23 3b7feef Mrdn 2y ago ))
24 3b7feef Mrdn 2y ago Progress.displayName = ProgressPrimitive.Root.displayName
25 3b7feef Mrdn 2y ago
26 3b7feef Mrdn 2y ago export { Progress }