You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

42 lines
1.4 KiB

import styles from './styles.module.css'
import Button from '@mui/material/Button';
import Dialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogTitle from '@mui/material/DialogTitle';
import { v4 } from "uuid"
interface ConfirmDialogInterface {
open: boolean
title: string
closeCallback?: any
modifyCallback?: any
agreeCallback?: any
children: any
}
export default function ConfirmDialog({open, title, agreeCallback, modifyCallback, closeCallback, children}: ConfirmDialogInterface) {
let dialogId = v4()
return (
<Dialog
open={open}
onClose={closeCallback}
aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description"
>
<DialogTitle>
{title}
</DialogTitle>
<DialogContent>
{children}
</DialogContent>
<DialogActions>
{agreeCallback && <Button onClick={() => agreeCallback(dialogId)} autoFocus>
Agree
</Button>}
{modifyCallback && <Button onClick={modifyCallback}>Modify</Button>}
{closeCallback && <Button onClick={closeCallback}>Disagree</Button>}
</DialogActions>
</Dialog>
);
}