2021-09-16 02:21:45 +02:00
|
|
|
import React from "react";
|
|
|
|
import { Modal } from "./Modal";
|
|
|
|
|
2021-09-17 01:23:03 +02:00
|
|
|
import Button from "@mui/material/Button";
|
|
|
|
import Typography from "@mui/material/Typography";
|
2021-09-16 02:21:45 +02:00
|
|
|
|
|
|
|
interface IProps {
|
2021-09-22 18:56:55 +02:00
|
|
|
open: boolean;
|
|
|
|
onClose: () => void;
|
|
|
|
onConfirm: () => void;
|
|
|
|
confirmationText: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function ConfirmationModal(props: IProps): React.ReactElement {
|
|
|
|
return (
|
|
|
|
<Modal open={props.open} onClose={props.onClose}>
|
|
|
|
<>
|
|
|
|
<Typography>{props.confirmationText}</Typography>
|
|
|
|
<Button
|
|
|
|
onClick={() => {
|
2021-09-16 02:21:45 +02:00
|
|
|
props.onConfirm();
|
2021-09-22 18:56:55 +02:00
|
|
|
}}
|
|
|
|
>
|
|
|
|
Confirm
|
|
|
|
</Button>
|
|
|
|
</>
|
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
}
|