import { Button } from "@mui/material"; import { useState } from "react"; import Cropper from "react-easy-crop"; import { cropImage, dataURLtoFile } from "./cropImg"; function Crop({ data, uploadImg, handleClose }) { const [crop, setCrop] = useState({ x: 0, y: 0 }); const [zoom, setZoom] = useState(1); const [croppedAreaPixels, setCroppedAreaPixels] = useState(null); const onComplete = async (imagePromise) => { const dataUrl = await imagePromise; const file = dataURLtoFile(dataUrl, "cropped-image.jpg"); uploadImg({ blob: dataUrl, file }); }; return (