@@ -40,7 +40,7 @@ function StepIcon({ state }: { state: StepState }) {
4040 case "error" :
4141 return < AlertCircle className = "h-4 w-4 text-destructive" />
4242 default :
43- return < Circle className = "h-4 w-4 text-muted-foreground/40 " />
43+ return < Circle className = "h-4 w-4 text-muted-foreground/30 " />
4444 }
4545}
4646
@@ -49,44 +49,64 @@ export function StepIndicator({
4949 state,
5050 progress,
5151} : StepIndicatorProps ) {
52+ const pct =
53+ state === "active" && progress ?. totalPages
54+ ? Math . round ( ( ( progress . page ?? 0 ) / progress . totalPages ) * 100 )
55+ : state === "completed"
56+ ? 100
57+ : 0
58+
5259 return (
53- < div className = "flex items-center gap-3 py-1.5" >
54- < StepIcon state = { state } />
55- < div className = "flex-1" >
56- < div
60+ < div
61+ className = { cn (
62+ "rounded-lg border p-3 transition-all" ,
63+ state === "active" && "border-blue-200 bg-blue-50/50" ,
64+ state === "completed" && "border-green-200 bg-green-50/30" ,
65+ state === "error" && "border-destructive/30 bg-destructive/5" ,
66+ state === "pending" && "border-border/50 bg-muted/20 opacity-60"
67+ ) }
68+ >
69+ < div className = "mb-2 flex items-center justify-between" >
70+ < span
5771 className = { cn (
58- "text-sm" ,
59- state === "active" && "font-medium text-foreground" ,
60- state === "completed" && "text-muted-foreground" ,
61- state === "pending" && "text-muted-foreground/60" ,
62- state === "error" && "text-destructive"
72+ "text-sm font-medium" ,
73+ state === "completed" && "text-green-700" ,
74+ state === "error" && "text-destructive" ,
75+ state === "pending" && "text-muted-foreground"
6376 ) }
6477 >
6578 { label }
66- </ div >
79+ </ span >
80+ < StepIcon state = { state } />
81+ </ div >
82+
83+ { /* Progress bar — always visible for active/completed */ }
84+ < div className = "h-1.5 rounded-full bg-muted/60" >
85+ < div
86+ className = { cn (
87+ "h-full rounded-full transition-all duration-300" ,
88+ state === "active" && "bg-blue-600" ,
89+ state === "completed" && "bg-green-500" ,
90+ state === "error" && "bg-destructive" ,
91+ state === "pending" && "bg-transparent"
92+ ) }
93+ style = { { width : `${ pct } %` } }
94+ />
95+ </ div >
96+
97+ { /* Status text */ }
98+ < div className = "mt-1.5 text-xs text-muted-foreground" >
6799 { state === "active" && progress ?. totalPages && (
68- < div className = "mt-1" >
69- < div className = "flex justify-between text-xs text-muted-foreground" >
70- < span >
71- { progress . page ?? 0 } / { progress . totalPages } pages
72- </ span >
73- < span >
74- { Math . round (
75- ( ( progress . page ?? 0 ) / progress . totalPages ) * 100
76- ) }
77- %
78- </ span >
79- </ div >
80- < div className = "mt-0.5 h-1.5 rounded-full bg-muted" >
81- < div
82- className = "h-full rounded-full bg-blue-600 transition-all"
83- style = { {
84- width : `${ ( ( progress . page ?? 0 ) / progress . totalPages ) * 100 } %` ,
85- } }
86- />
87- </ div >
88- </ div >
100+ < span >
101+ { progress . page ?? 0 } / { progress . totalPages } pages
102+ </ span >
103+ ) }
104+ { state === "active" && ! progress ?. totalPages && (
105+ < span > Processing...</ span >
89106 ) }
107+ { state === "completed" && < span > Done</ span > }
108+ { state === "error" && < span > Failed</ span > }
109+ { state === "pending" && < span > Waiting</ span > }
90110 </ div >
91111 </ div >
92112 )
0 commit comments