import React, { useState } from 'react'; import { Dialog, DialogTitle, DialogContent, DialogActions, DialogProps, } from '@mui/material'; export interface ModalProps extends Omit { open?: boolean; onClose?: () => void; title?: string; description?: string; maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false; fullScreen?: boolean; fullWidth?: boolean; showCloseButton?: boolean; footer?: React.ReactNode; } export const Modal: React.FC = ({ open = false, onClose, title, description, maxWidth = 'sm', fullScreen = false, fullWidth = true, showCloseButton = true, footer, children, sx, ...props }) => { const handleClose = () => { if (onClose) { onClose(); } }; return ( {(title || showCloseButton) && (
{title && (
{title}
)} {description && (
{description}
)}
{showCloseButton && ( )}
)} {children} {footer && ( {footer} )}
); }; export default Modal;