import { m, AnimatePresence } from 'framer-motion'; // @mui import { alpha } from '@mui/material/styles'; import Stack from '@mui/material/Stack'; import IconButton from '@mui/material/IconButton'; import ListItemText from '@mui/material/ListItemText'; // utils import { fData } from 'src/utils/format-number'; // import Iconify from '../iconify'; import { varFade } from '../animate'; import FileThumbnail, { fileData } from '../file-thumbnail'; // import { UploadProps } from './types'; // ---------------------------------------------------------------------- export default function MultiFilePreview({ thumbnail, files, onRemove, sx }: UploadProps) { return ( {files?.map((file) => { const { key, name = '', size = 0 } = fileData(file); const isNotFormatFile = typeof file === 'string'; if (thumbnail) { return ( `solid 1px ${alpha(theme.palette.grey[500], 0.16)}`, ...sx, }} > {onRemove && ( onRemove(file)} sx={{ p: 0.5, top: 4, right: 4, position: 'absolute', color: 'common.white', bgcolor: (theme) => alpha(theme.palette.grey[900], 0.48), '&:hover': { bgcolor: (theme) => alpha(theme.palette.grey[900], 0.72), }, }} > )} ); } return ( `solid 1px ${alpha(theme.palette.grey[500], 0.16)}`, ...sx, }} > {onRemove && ( onRemove(file)}> )} ); })} ); }