Merge branch '20454-cost-display' refs #20454
[arvados.git] / src / views-components / remove-dialog / remove-dialog.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import React from "react";
6 import { Dialog, DialogTitle, DialogContent, DialogActions, Button } from "@material-ui/core";
7 import { withDialog } from "store/dialog/with-dialog";
8 import { dialogActions } from "store/dialog/dialog-actions";
9
10 export const REMOVE_DIALOG = 'removeCollectionFilesDialog';
11
12 export const RemoveDialog = withDialog(REMOVE_DIALOG)(
13     (props) =>
14         <Dialog open={props.open}>
15             <DialogTitle>{`Removing ${props.data}`}</DialogTitle>
16             <DialogContent>
17                 {`Are you sure you want to remove ${props.data}?`}
18             </DialogContent>
19             <DialogActions>
20                 <Button
21                     variant='text'
22                     color='primary'
23                     onClick={props.closeDialog}>
24                     Cancel
25                 </Button>
26                 <Button variant='contained' color='primary'>
27                     Remove
28                 </Button>
29             </DialogActions>
30         </Dialog>
31 );
32
33 export const openRemoveDialog = (removedDataName: string) =>
34     dialogActions.OPEN_DIALOG({ id: REMOVE_DIALOG, data: removedDataName });