import { Box, Typography, useTheme } from "@mui/material"; import { SxProps, Theme } from "@mui/material/styles"; import type { DragEvent } from "react"; interface Props { sx?: SxProps; icon: React.ReactNode; handleDrop?: (event: DragEvent) => void; text?: string; ref?: any; } export default function UploadBox({ sx, icon, text, ref, handleDrop }: Props) { const theme = useTheme(); return ( ) => event.preventDefault()} onDrop={handleDrop} ref={ref} sx={{ width: "100%", height: "120px", position: "relative", display: "flex", justifyContent: "center", alignItems: "center", backgroundColor: theme.palette.background.default, border: `1px solid ${theme.palette.grey2.main}`, borderRadius: "8px", ...sx, }} > {icon} {text} ); }