-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgressIndicator.tsx
More file actions
117 lines (109 loc) · 4.18 KB
/
ProgressIndicator.tsx
File metadata and controls
117 lines (109 loc) · 4.18 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import { FC } from 'react';
import { Toggle } from '@/components/ui/toggle';
import { Separator } from '@/components/ui/separator';
import { Badge } from '@/components/ui/badge';
import { AlertCircle } from 'lucide-react';
interface ProgressIndicatorProps {
steps: string[];
currentStep: number;
mode: 'preview' | 'live';
onModeChange?: (mode: 'preview' | 'live') => void;
className?: string;
}
const ProgressIndicator: FC<ProgressIndicatorProps> = ({
steps,
currentStep,
mode,
onModeChange,
className = ''
}) => {
return (
<div className={`mb-8 ${className}`}>
{/* Mode Toggle */}
<div className="flex justify-between items-center mb-6">
<h2 className="text-xl font-medium text-slate-800">Document Signing Process</h2>
<div className="flex items-center space-x-2">
<span className="text-sm font-medium text-slate-500">Mode:</span>
<div className="flex border rounded-lg overflow-hidden">
<Toggle
pressed={mode === 'preview'}
onPressedChange={() => onModeChange?.('preview')}
className={`rounded-none border-0 ${mode === 'preview' ? 'bg-orange-50 text-orange-700' : ''}`}
>
PREVIEW
</Toggle>
<Separator orientation="vertical" className="h-full" />
<Toggle
pressed={mode === 'live'}
onPressedChange={() => onModeChange?.('live')}
className={`rounded-none border-0 ${mode === 'live' ? 'bg-blue-50 text-blue-700' : ''}`}
>
LIVE
</Toggle>
</div>
</div>
</div>
{/* Steps */}
<div className="flex items-center w-full">
{steps.map((step, index) => (
<div key={step} className="flex-1 relative">
{/* Step Number */}
<div className="flex items-center">
<div
className={`w-10 h-10 rounded-full flex items-center justify-center text-sm font-medium border-2 z-10
${index < currentStep
? 'bg-primary text-white border-primary'
: index === currentStep
? 'border-primary text-primary bg-white'
: 'border-slate-300 text-slate-400 bg-white'
}`}
>
{index + 1}
</div>
{/* Step Name */}
<div className="ml-2 text-sm font-medium">
{step}
{index === currentStep && mode === 'preview' && (
<Badge variant="outline" className="ml-2 bg-orange-50 text-orange-700 border-orange-200">
Preview
</Badge>
)}
{index === currentStep && mode === 'live' && (
<Badge variant="outline" className="ml-2 bg-blue-50 text-blue-700 border-blue-200">
Live
</Badge>
)}
</div>
</div>
{/* Connector Line */}
{index < steps.length - 1 && (
<div
className={`absolute top-5 left-10 w-full h-0.5
${index < currentStep ? 'bg-primary' : 'bg-slate-200'}`}
></div>
)}
</div>
))}
</div>
{/* Mode Info */}
{mode === 'preview' ? (
<div className="mt-6 p-3 bg-orange-50 rounded-md flex items-start text-orange-800 text-sm">
<AlertCircle className="h-5 w-5 mr-2 flex-shrink-0" />
<div>
<p className="font-medium">PREVIEW Mode</p>
<p>Use this mode to test the workflow without consuming your document signing quota.</p>
</div>
</div>
) : (
<div className="mt-6 p-3 bg-blue-50 rounded-md flex items-start text-blue-800 text-sm">
<AlertCircle className="h-5 w-5 mr-2 flex-shrink-0" />
<div>
<p className="font-medium">LIVE Mode</p>
<p>This will create legally binding documents and consume your quota. Make sure all details are correct.</p>
</div>
</div>
)}
</div>
);
};
export default ProgressIndicator;