bitburner-src/src/ui/React/ConfirmationModal.tsx

30 lines
637 B
TypeScript
Raw Normal View History

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";
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={() => {
props.onConfirm();
2021-09-22 18:56:55 +02:00
}}
>
Confirm
</Button>
</>
</Modal>
);
}