Skip to content

Commit 00f7225

Browse files
D-K-Pmatt-aitken
authored andcommitted
Added prog bar
1 parent 2b34f9e commit 00f7225

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

product-image-generator/app/components/UploadCard.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export default function UploadCard({
183183
</Button>
184184
</div>
185185
</div>
186-
) : isUploading || isLoading || run?.id ? (
186+
) : isUploading || isLoading || run?.id || progress ? (
187187
// Show progress state when loading or run exists
188188
<div className="h-full flex flex-col items-center justify-center p-6 text-center">
189189
<div className="w-8 h-8 rounded-full flex items-center justify-center mb-4 transition-colors ">
@@ -202,23 +202,23 @@ export default function UploadCard({
202202
? "Preparing..."
203203
: "Please wait"}
204204
</p>
205-
{(progress || isUploading) && (
206-
<div className="w-full bg-gray-200 rounded-full h-2 mt-2">
207-
<div
208-
className="bg-primary h-2 rounded-full transition-all duration-300"
209-
style={{
210-
width: progress
211-
? `${(progress.step / progress.total) * 100}%`
212-
: "0%",
213-
}}
214-
></div>
215-
</div>
216-
)}
205+
206+
<div className="w-full bg-gray-200 rounded-full h-2 mt-2">
207+
<div
208+
className="bg-primary h-2 rounded-full transition-all duration-300"
209+
style={{
210+
width: progress
211+
? `${(progress.step / progress.total) * 100}%`
212+
: "0%",
213+
}}
214+
></div>
215+
</div>
216+
217217
{run?.id && (
218-
<p className="text-xxs text-gray-600 mt-2">Run ID: {run.id}</p>
218+
<p className="text-xs text-gray-600 mt-2">Run ID: {run.id}</p>
219219
)}
220220
{error && (
221-
<p className="text-xxs text-red-600 mt-2">Error: {error.message}</p>
221+
<p className="text-xs text-red-600 mt-2">Error: {error.message}</p>
222222
)}
223223
</div>
224224
) : (

0 commit comments

Comments
 (0)