forked from jordanlambrecht/tracker-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgressWidget.tsx
More file actions
45 lines (41 loc) · 1 KB
/
Copy pathProgressWidget.tsx
File metadata and controls
45 lines (41 loc) · 1 KB
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
37
38
39
40
41
42
43
44
45
// src/components/ui/ProgressWidget.tsx
import { SlotLabel } from "@typography"
import clsx from "clsx"
import { ProgressBar } from "@/components/ui/ProgressBar"
interface ProgressWidgetProps {
label: string
value: string
percent: number
color: string
footer?: string
inset?: boolean
className?: string
}
function ProgressWidget({
label,
value,
percent,
color,
footer,
inset = false,
className,
}: ProgressWidgetProps) {
return (
<div
className={clsx(
"flex flex-col gap-2",
inset && "nm-inset-sm bg-control-bg rounded-nm-md p-4",
className
)}
>
<div className="flex items-center justify-between">
<SlotLabel label={label} />
<span className="text-xs font-mono text-secondary font-semibold">{value}</span>
</div>
<ProgressBar percent={percent} color={color} size="sm" />
{footer && <p className="timestamp text-right">{footer}</p>}
</div>
)
}
export type { ProgressWidgetProps }
export { ProgressWidget }