mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-11 01:57:49 +02:00
32 lines
777 B
TypeScript
32 lines
777 B
TypeScript
import React from "react";
|
|
import { Modal } from "./Modal";
|
|
|
|
import Button from "@mui/material/Button";
|
|
import Typography from "@mui/material/Typography";
|
|
|
|
interface IProps {
|
|
open: boolean;
|
|
onClose: () => void;
|
|
onConfirm: () => void;
|
|
confirmationText: string | React.ReactNode;
|
|
additionalButton?: React.ReactNode;
|
|
}
|
|
|
|
export function ConfirmationModal(props: IProps): React.ReactElement {
|
|
return (
|
|
<Modal open={props.open} onClose={props.onClose}>
|
|
<>
|
|
<Typography component={"div"}>{props.confirmationText}</Typography>
|
|
<Button
|
|
onClick={() => {
|
|
props.onConfirm();
|
|
}}
|
|
>
|
|
Confirm
|
|
</Button>
|
|
{props.additionalButton && <>{props.additionalButton}</>}
|
|
</>
|
|
</Modal>
|
|
);
|
|
}
|