diff --git a/website/src/components/color-extractor.tsx b/website/src/components/color-extractor.tsx index c30ec0b..c9810e4 100644 --- a/website/src/components/color-extractor.tsx +++ b/website/src/components/color-extractor.tsx @@ -69,11 +69,11 @@ export function ColorExtractor () { } const processFiles = async (formData: FormData) => { + setIsLoading(true) const res = await fetch('/api/', { method: 'POST', body: formData }) - setColors(await res.json()) if (!imageUrl) setImageUrl(await getBase64(formData.get('file') as File)) setIsLoading(false) @@ -130,25 +130,21 @@ export function ColorExtractor () { )} ) : ( -
+
Uploaded image -
-
- {colors.map((color, index) => ( -
copyToClipboard(color.hex, `Color ${color.hex}`)} - key={index} - className='cursor-pointer rounded-lg shadow-md lg:h-24 lg:w-24 h-20 w-20' - style={{ backgroundColor: color.hex }} - > -
- - {color.hex.toUpperCase()} - -
+
+ {colors.map((color, index) => ( +
copyToClipboard(color.hex, `Color ${color.hex}`)} + key={index} + className='cursor-pointer rounded-lg shadow-md h-20 w-20' + style={{ backgroundColor: color.hex }} + > +
+ {color.hex.toUpperCase()}
- ))} -
+
+ ))}