import { useDropzone } from 'react-dropzone'; // @mui import { styled } from '@mui/material/styles'; import { Box } from '@mui/material'; // type import { UploadMultiFileProps } from './type'; // import BlockContent from './BlockContent'; import RejectionFiles from './RejectionFiles'; import MultiFilePreview from './MultiFilePreview'; // ---------------------------------------------------------------------- const DropZoneStyle = styled('div')(({ theme }) => ({ outline: 'none', padding: theme.spacing(5, 1), borderRadius: theme.shape.borderRadius, backgroundColor: theme.palette.background.neutral, border: `1px dashed ${theme.palette.grey[500_32]}`, '&:hover': { opacity: 0.72, cursor: 'pointer' }, })); // ---------------------------------------------------------------------- export default function UploadMultiFile({ error, showPreview = false, files, onRemove, onRemoveAll, helperText, sx, ...other }: UploadMultiFileProps) { const { getRootProps, getInputProps, isDragActive, isDragReject, fileRejections } = useDropzone({ ...other, }); return ( {fileRejections.length > 0 && } {helperText && helperText} ); }