27 lines
755 B
TypeScript
27 lines
755 B
TypeScript
import * as React from 'react';
|
|
import { Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@mui/material';
|
|
|
|
interface ModalProps {
|
|
open: boolean;
|
|
onClose: () => void;
|
|
title: string;
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
const Modal: React.FC<ModalProps> = ({ open, onClose, title, children }) => {
|
|
return (
|
|
<Dialog open={open} onClose={onClose} fullWidth maxWidth="md">
|
|
<DialogTitle>{title}</DialogTitle>
|
|
<DialogContent>
|
|
{children}
|
|
</DialogContent>
|
|
<DialogActions>
|
|
<Button onClick={onClose} color="primary">
|
|
Close
|
|
</Button>
|
|
</DialogActions>
|
|
</Dialog>
|
|
);
|
|
};
|
|
|
|
export default Modal; |