"use client"; import { useCallback, useState } from "react"; import { FileWithPath } from "react-dropzone"; import Dropzone from "../dropzone"; interface Props { setImage: React.Dispatch>; } export default function PortraitUpload({ setImage }: Props) { const [hasImage, setHasImage] = useState(false); const handleDrop = useCallback( (acceptedFiles: FileWithPath[]) => { const file = acceptedFiles[0]; // Convert to Data URI const reader = new FileReader(); reader.onload = async (event) => { setImage(event.target!.result as string); setHasImage(true); }; reader.readAsDataURL(file); }, [setImage], ); return (

{!hasImage ? ( <> Drag and drop a screenshot of your Mii's features here
or click to open ) : ( "Uploaded!" )}

); }