-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: functionality added waiting for backend request
- Loading branch information
1 parent
ad537cf
commit cabf628
Showing
3 changed files
with
104 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"use client"; | ||
|
||
import * as React from "react"; | ||
import * as ProgressPrimitive from "@radix-ui/react-progress"; | ||
|
||
import { cn } from "@/lib/utils"; | ||
|
||
const Progress = React.forwardRef< | ||
React.ElementRef<typeof ProgressPrimitive.Root>, | ||
React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> | ||
>(({ className, value, ...props }, ref) => ( | ||
<ProgressPrimitive.Root | ||
ref={ref} | ||
className={cn( | ||
"relative h-4 w-full overflow-hidden rounded-full bg-secondary", | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument | ||
className | ||
)} | ||
{...props}> | ||
<ProgressPrimitive.Indicator | ||
className="size-full flex-1 bg-primary transition-all" | ||
style={{ transform: `translateX(-${100 - (value ?? 0)}%)` }} | ||
/> | ||
</ProgressPrimitive.Root> | ||
)); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment | ||
Progress.displayName = ProgressPrimitive.Root.displayName; | ||
|
||
export { Progress }; |