11import { useCallback } from 'react'
22import './upload-progress.css'
33import { CardHeader , CardWrapper } from '../ui/card.tsx'
4+ import { ProgressBar } from '../ui/progress-bar.tsx'
45
56export interface UploadProgress {
67 step : 'creating-car' | 'uploading-car' | 'checking-readiness' | 'announcing-cids' | 'finalizing-transaction'
@@ -133,17 +134,10 @@ export default function UploadProgress({
133134 { /* Combined first stage: creating-car + checking-readiness + uploading-car */ }
134135 { progress . find ( ( p ) => p . step === 'creating-car' ) && (
135136 < CardWrapper >
136- < div className = "step-content" >
137- < CardHeader status = { getCombinedFirstStageStatus ( ) } title = { getStepLabel ( 'creating-car' ) } />
138- { getCombinedFirstStageStatus ( ) === 'in-progress' && (
139- < div className = "progress-bar-container" >
140- < div className = "progress-bar" >
141- < div className = "progress-fill" style = { { width : `${ getCombinedFirstStageProgress ( ) } %` } } />
142- </ div >
143- < span className = "progress-text" > { getCombinedFirstStageProgress ( ) } %</ span >
144- </ div >
145- ) }
146- </ div >
137+ < CardHeader status = { getCombinedFirstStageStatus ( ) } title = { getStepLabel ( 'creating-car' ) } />
138+ { getCombinedFirstStageStatus ( ) === 'in-progress' && (
139+ < ProgressBar progress = { getCombinedFirstStageProgress ( ) } />
140+ ) }
147141 </ CardWrapper >
148142 ) }
149143
@@ -156,18 +150,9 @@ export default function UploadProgress({
156150 . map ( ( step ) => {
157151 return (
158152 < CardWrapper key = { step . step } >
159- < div className = "step-content" >
160- < CardHeader status = { step . status } title = { getStepLabel ( step . step ) } />
161- { step . status === 'in-progress' && (
162- < div className = "progress-bar-container" >
163- < div className = "progress-bar" >
164- < div className = "progress-fill" style = { { width : `${ step . progress } %` } } />
165- </ div >
166- < span className = "progress-text" > { step . progress } %</ span >
167- </ div >
168- ) }
169- { step . error && < div className = "error-message" > { step . error } </ div > }
170- </ div >
153+ < CardHeader status = { step . status } title = { getStepLabel ( step . step ) } />
154+ { step . status === 'in-progress' && < ProgressBar progress = { step . progress } /> }
155+ { step . error && < div className = "error-message" > { step . error } </ div > }
171156 </ CardWrapper >
172157 )
173158 } ) }
0 commit comments