1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from "react";
6 import { Dialog, DialogTitle, DialogContent, DialogActions, Button, DialogContentText } from "@material-ui/core";
7 import { WithDialogProps } from "~/store/dialog/with-dialog";
8 import { WarningIcon } from '~/components/icon/icon';
10 export interface ConfirmationDialogDataProps {
14 cancelButtonLabel?: string;
15 confirmButtonLabel?: string;
18 export interface ConfirmationDialogProps {
19 onConfirm: () => void;
22 export const ConfirmationDialog = (props: ConfirmationDialogProps & WithDialogProps<ConfirmationDialogDataProps>) =>
23 <Dialog open={props.open}>
24 <DialogTitle>{props.data.title}</DialogTitle>
25 <DialogContent style={{ display: 'flex', alignItems: 'center' }}>
27 <DialogContentText style={{ paddingLeft: '8px' }}>
28 <div>{props.data.text}</div>
29 <div>{props.data.info}</div>
32 <DialogActions style={{ margin: '0px 24px 24px' }}>
36 onClick={props.closeDialog}>
37 {props.data.cancelButtonLabel || 'Cancel'}
43 onClick={props.onConfirm}>
44 {props.data.confirmButtonLabel || 'Ok'}