Skip to content

Commit 1addccd

Browse files
D-K-Pmatt-aitken
authored andcommitted
styled remaining cards
1 parent 27b8666 commit 1addccd

2 files changed

Lines changed: 17 additions & 20 deletions

File tree

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

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ export default function CustomPromptCard({
103103
baseImageUrl,
104104
productAnalysis,
105105
customPrompt: customPrompt.trim(),
106-
size: "1024x1792",
107106
});
108107

109108
if (result.success) {
@@ -135,7 +134,6 @@ export default function CustomPromptCard({
135134
baseImageUrl,
136135
productAnalysis,
137136
customPrompt: customPrompt.trim(),
138-
size: "1024x1792",
139137
});
140138

141139
if (result.success) {
@@ -245,16 +243,6 @@ export default function CustomPromptCard({
245243
>
246244
<Download className="h-4 w-4" />
247245
</Button>
248-
<Button
249-
size="sm"
250-
variant="secondary"
251-
className="w-8 h-8 rounded-full p-0 backdrop-blur-sm bg-white/90 hover:bg-white"
252-
onClick={handleReset}
253-
disabled={isRegenerating && isGenerating}
254-
title="Create new image"
255-
>
256-
<RotateCcw className="h-4 w-4" />
257-
</Button>
258246
</div>
259247
{/* Title overlay */}
260248
<div className="absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-3">
@@ -268,10 +256,10 @@ export default function CustomPromptCard({
268256
<div className="h-full flex flex-col p-4">
269257
<div className="flex-1 flex flex-col justify-center">
270258
<form onSubmit={handleSubmit} className="space-y-4">
271-
<div>
259+
<div className="flex flex-col gap-2 items-center">
272260
<label
273261
htmlFor="custom-prompt"
274-
className="block text-sm font-medium text-foreground mb-4"
262+
className="block text-sm font-medium text-foreground mb-2"
275263
>
276264
Add another product shot
277265
</label>
@@ -281,7 +269,7 @@ export default function CustomPromptCard({
281269
value={customPrompt}
282270
onChange={(e) => setCustomPrompt(e.target.value)}
283271
disabled={isGenerating}
284-
className="w-full h-20 px-3 text-sm border border-input bg-transparent rounded-md shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 resize-none"
272+
className="w-full h-48 p-3 text-sm border border-input bg-transparent rounded-md shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 resize-none"
285273
rows={3}
286274
autoFocus
287275
/>

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,11 @@ export default function GeneratedCard({
248248
) : (
249249
// Show loading/waiting state
250250
<div className="h-full flex flex-col items-center justify-center p-6 text-center">
251-
<div className="w-12 h-12 rounded-lg bg-gray-300/20 flex items-center justify-center mb-4">
251+
<div className="w-12 h-12 rounded-lg flex items-center justify-center mb-4">
252252
{isTaskRunning && generationProgress === "generating" ? (
253-
<div className="animate-spin rounded-full h-6 w-6 border-b-2 border-primary"></div>
253+
<div className="animate-spin rounded-full h-6 w-6 border-b-2 border-primary">
254+
<Loader2 className="h-6 w-6 text-gray-500" />
255+
</div>
254256
) : baseImageUrl && productAnalysis && !hasTriggered ? (
255257
<Button
256258
size="sm"
@@ -276,18 +278,25 @@ export default function GeneratedCard({
276278
? "Click to generate"
277279
: "Waiting for upload...")}
278280
</p>
279-
{progressData && generationProgress === "generating" && (
281+
282+
{(isTaskRunning || progressData) && (
280283
<>
281284
<div className="w-full bg-gray-200 rounded-full h-2 mb-2">
282285
<div
283286
className="bg-primary h-2 rounded-full transition-all duration-300"
284287
style={{
285-
width: `${(progressData.step / progressData.total) * 100}%`,
288+
width: `${
289+
progressData
290+
? (progressData.step / progressData.total) * 100
291+
: 0
292+
}%`,
286293
}}
287294
></div>
288295
</div>
289296
<p className="text-xs text-muted-foreground">
290-
Step {progressData.step} of {progressData.total}
297+
{progressData
298+
? `Step ${progressData.step} of ${progressData.total}`
299+
: "Starting..."}
291300
</p>
292301
</>
293302
)}

0 commit comments

Comments
 (0)