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 {
13 cancelButtonLabel?: string;
14 confirmButtonLabel?: string;
17 export interface ConfirmationDialogProps {
18 onConfirm: () => void;
21 export const ConfirmationDialog = (props: ConfirmationDialogProps & WithDialogProps<ConfirmationDialogDataProps>) =>
22 <Dialog open={props.open}>
23 <DialogTitle>{props.data.title}</DialogTitle>
24 <DialogContent style={{ display: 'flex', alignItems: 'center' }}>
26 <DialogContentText style={{ paddingLeft: '8px' }}>
29 {props.data.title === 'Removing file' ? 'Removing a file will change content adress.' : 'Removing files will change content adress.'}
36 onClick={props.closeDialog}>
37 {props.data.cancelButtonLabel || 'Cancel'}
43 onClick={props.onConfirm}>
44 {props.data.confirmButtonLabel || 'Ok'}