import { FileRejection } from 'react-dropzone'; // @mui import { alpha } from '@mui/material/styles'; import Box from '@mui/material/Box'; import Paper from '@mui/material/Paper'; import Typography from '@mui/material/Typography'; // utils import { fData } from 'src/utils/format-number'; // import { fileData } from '../file-thumbnail'; // ---------------------------------------------------------------------- type Props = { fileRejections: FileRejection[]; }; export default function RejectionFiles({ fileRejections }: Props) { if (!fileRejections.length) { return null; } return ( alpha(theme.palette.error.main, 0.08), }} > {fileRejections.map(({ file, errors }) => { const { path, size } = fileData(file); return ( {path} - {size ? fData(size) : ''} {errors.map((error) => ( - {error.message} ))} ); })} ); }