feat: add reprocess button to re-run AI background removal on image cards

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-24 20:52:18 +02:00
parent 03770d1a76
commit c95093a81f
3 changed files with 25 additions and 2 deletions
+11
View File
@@ -11,6 +11,7 @@ interface ImageCardProps {
onRemove: (id: string) => void
onOpenLightbox: (item: ImageItem) => void
onAssignProduct: (id: string, shopifyProductId: string, shopifyProductTitle: string) => void
onReprocess: (id: string) => void
}
const STATUS_LABELS: Record<string, { label: string; color: string }> = {
@@ -101,6 +102,7 @@ export function ImageCard({
onRemove,
onOpenLightbox,
onAssignProduct,
onReprocess,
}: ImageCardProps) {
const statusInfo = STATUS_LABELS[item.status] ?? { label: item.status, color: 'text-slate-400' }
const isProcessing = ['pending', 'converting', 'processing', 'searching', 'uploading'].includes(item.status)
@@ -201,6 +203,15 @@ export function ImageCard({
Uploader
</button>
)}
{(item.status === 'ready' || item.status === 'uploaded' || item.status === 'skipped' || item.status === 'error' || item.status === 'not_found') && item.rawPngBlob && (
<button
onClick={() => onReprocess(item.id)}
title="Relancer le détourage IA"
className="py-1.5 px-2 text-xs bg-slate-800 hover:bg-amber-900 text-slate-400 hover:text-amber-300 rounded"
>
🔄
</button>
)}
{item.status === 'uploaded' && item.uploadedUrl && (
<a
href={item.uploadedUrl}