-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #560 from Sienci-Labs/MI-1525-features-job-progress
Features: Job Progress
- Loading branch information
Showing
16 changed files
with
1,104 additions
and
602 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,30 +1,66 @@ | ||
// https://ui.shadcn.com/docs/components/progress | ||
|
||
"use client" | ||
'use client'; | ||
|
||
import * as React from "react" | ||
import * as ProgressPrimitive from "@radix-ui/react-progress" | ||
import * as React from 'react'; | ||
import * as ProgressPrimitive from '@radix-ui/react-progress'; | ||
|
||
import cx from "classnames" | ||
import cx from 'classnames'; | ||
|
||
interface Props { | ||
Bit?: string; | ||
className?: string; | ||
value: number; | ||
style?: React.CSSProperties; | ||
} | ||
|
||
const Progress = React.forwardRef< | ||
React.ElementRef<typeof ProgressPrimitive.Root>, | ||
React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> | ||
>(({ className, value, ...props }, ref) => ( | ||
<ProgressPrimitive.Root | ||
ref={ref} | ||
className={cx( | ||
"relative h-4 w-full overflow-hidden rounded-full bg-secondary", | ||
className | ||
)} | ||
{...props} | ||
React.ElementRef< | ||
typeof ProgressPrimitive.Root & React.ForwardRefExoticComponent<Props> | ||
>, | ||
React.ComponentPropsWithoutRef< | ||
typeof ProgressPrimitive.Root & React.ForwardRefExoticComponent<Props> | ||
> | ||
<ProgressPrimitive.Indicator | ||
className="h-full w-full flex-1 bg-primary transition-all" | ||
style={{ transform: `translateX(-${100 - (value || 0)}%)` }} | ||
/> | ||
</ProgressPrimitive.Root> | ||
)) | ||
Progress.displayName = ProgressPrimitive.Root.displayName | ||
>(({ className, value, style, Bit, ...props }, ref) => ( | ||
<div className="overflow-visible relative h-4 w-full rounded-full"> | ||
<ProgressPrimitive.Root | ||
ref={ref} | ||
className={cx('relative h-4 w-full rounded-full', className)} | ||
{...props} | ||
> | ||
<div className="overflow-hidden h-full w-full"> | ||
<ProgressPrimitive.Indicator | ||
className="h-full w-full flex-1 transition-all bg-black" | ||
style={{ | ||
transform: `translateX(-${100 - (value || 0)}%)`, | ||
}} | ||
/> | ||
</div> | ||
{Bit && ( | ||
<div | ||
className="h-full w-full flex-1 transition-all absolute bottom-0" | ||
style={{ | ||
transform: `translateX(-${100 - (value || 0)}%)`, | ||
}} | ||
> | ||
<img | ||
src={Bit} | ||
className="absolute bottom-0 right-[-5px] h-14" | ||
/> | ||
</div> | ||
)} | ||
</ProgressPrimitive.Root> | ||
{/* <div className="absolute bottom-0 left-0 transition-all flex-1 h-full w-full"> | ||
<img | ||
src={Bit} | ||
style={{ | ||
transform: `translateX(-${100 - (value || 0)}%)`, | ||
}} | ||
className="h-14" | ||
/> | ||
</div> */} | ||
</div> | ||
)); | ||
Progress.displayName = ProgressPrimitive.Root.displayName; | ||
|
||
export { Progress } | ||
export { Progress }; |
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
Oops, something went wrong.