/** * EditResultGrid - Grid display of generated edit results. * * Shows 2-4 result images with actions to use, download, or retry. */ import React from 'react'; import { Check, RefreshCw, Download } from 'lucide-react'; import { resolveFileUrl } from '../resolveFileUrl'; export function EditResultGrid({ images, onUse, onTryAgain, onOpen, disabled, }) { // Don't render if no images if (!images?.length) { return null; } const handleDownload = async (url, e) => { e.stopPropagation(); try { const response = await fetch(url); const blob = await response.blob(); const blobUrl = URL.createObjectURL(blob); const link = document.createElement('a'); link.href = blobUrl; link.download = `edit-result-${Date.now()}.png`; document.body.appendChild(link); link.click(); document.body.removeChild(link); URL.revokeObjectURL(blobUrl); } catch (error) { // Fallback: open in new tab window.open(url, '_blank'); } }; return (
Click an image to view full size, or click "Use this" to continue editing