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 <div data-cy='confirmation-dialog'>
25 <DialogTitle>{props.data.title}</DialogTitle>
26 <DialogContent style={{ display: 'flex', alignItems: 'center' }}>
28 <DialogContentText style={{ paddingLeft: '8px' }}>
29 <div>{props.data.text}</div>
30 <div>{props.data.info}</div>
33 <DialogActions style={{ margin: '0px 24px 24px' }}>
35 data-cy='confirmation-dialog-cancel-btn'
38 onClick={props.closeDialog}>
39 {props.data.cancelButtonLabel || 'Cancel'}
42 data-cy='confirmation-dialog-ok-btn'
46 onClick={props.onConfirm}>
47 {props.data.confirmButtonLabel || 'Ok'}