(files: File[])
| 88 | }; |
| 89 | |
| 90 | const processFiles = async (files: File[]) => { |
| 91 | setIsConverting(true); |
| 92 | const imageFiles = files.filter(file => |
| 93 | ['image/webp', 'image/avif', 'image/jpeg', 'image/png', 'image/gif', 'image/tiff', 'image/bmp'].includes(file.type) |
| 94 | ); |
| 95 | |
| 96 | const converted = await Promise.all(imageFiles.map(convertToWebP)); |
| 97 | setConvertedImages(prev => [...prev, ...converted]); |
| 98 | setIsConverting(false); |
| 99 | }; |
| 100 | |
| 101 | const handleDownload = (image: ConvertedImage) => { |
| 102 | const url = URL.createObjectURL(image.webpBlob); |
no outgoing calls
no test coverage detected