import { Button, CircularProgress, Dialog, DialogActions, DialogContent, DialogTitle, Slider, } from "@mui/material"; import React from "react"; import Cropper, { Area } from "react-easy-crop"; export function ImageCropperDialog(p: { src: string; onCancel: () => void; onSubmit: (croppedArea: Area | undefined) => void; processing: boolean; aspect?: number; }): React.ReactElement { const [crop, setCrop] = React.useState({ x: 0, y: 0 }); const [zoom, setZoom] = React.useState(1); const [croppedArea, setCroppedArea] = React.useState(); const submit = () => { p.onSubmit(croppedArea); }; return ( Rogner l'image
setCroppedArea(b)} onZoomChange={setZoom} maxZoom={4} />
setZoom(Number(v))} />
{p.processing ? ( ) : ( <> )}
); }