forked from Dshield-xyz/Dshield
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgressSteps.tsx
More file actions
37 lines (35 loc) · 1.12 KB
/
Copy pathProgressSteps.tsx
File metadata and controls
37 lines (35 loc) · 1.12 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
import { Spinner } from "./Spinner";
export interface ProgressStepsProps {
/** Human-readable label for the current step. */
label: string;
/** Ordered list of step keys that make up the flow. */
steps: readonly string[];
/** The currently active step key. */
current: string;
}
/**
* Spinner + label + segmented progress bar. Shared by the withdraw and
* compliance flows, which both advance through an ordered list of step keys.
* A segment is filled once the current step's index reaches it.
*/
export function ProgressSteps({ label, steps, current }: ProgressStepsProps) {
const currentIndex = steps.indexOf(current);
return (
<div className="rounded-xl bg-zinc-800/80 p-4">
<div className="flex items-center gap-3">
<Spinner />
<span className="text-sm text-zinc-300">{label}</span>
</div>
<div className="mt-3 flex gap-1">
{steps.map((step, i) => (
<div
key={step}
className={`h-1 flex-1 rounded-full ${
currentIndex >= i ? "bg-white" : "bg-zinc-700"
}`}
/>
))}
</div>
</div>
);
}