import React from 'react'; import { X, CheckCircle, AlertCircle, Loader2, Download } from 'lucide-react'; import type { ImageFile } from '../types'; import { formatFileSize } from '../utils/imageProcessing'; import { downloadImage } from '../utils/download'; interface ImageListProps { images: ImageFile[]; onRemove: (id: string) => void; } export function ImageList({ images, onRemove }: ImageListProps) { if (images.length === 0) return null; return (
{images.map((image) => (
{image.preview && ( {image.file.name} )}

{image.file.name}

{image.status === 'complete' && ( )}
{image.status === 'pending' && ( Ready to process )} {image.status === 'processing' && ( Processing... )} {image.status === 'complete' && ( Complete )} {image.status === 'error' && ( {image.error || 'Error processing image'} )}
{formatFileSize(image.originalSize)} {image.compressedSize && ( <> {' → '} {formatFileSize(image.compressedSize)}{' '} ( {Math.round( ((image.originalSize - image.compressedSize) / image.originalSize) * 100 )} % smaller) )}
))}
); }