metadata-without-navigation
[arvados.git] / src / views-components / file-remove-dialog / multiple-files-remove-dialog.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { Dispatch } from "redux";
6 import { connect } from "react-redux";
7 import { MULTIPLE_FILES_REMOVE_DIALOG, removeCollectionsSelectedFiles } from "../../store/collection-panel/collection-panel-files/collection-panel-files-actions";
8 import { ConfirmationDialog } from "~/components/confirmation-dialog/confirmation-dialog";
9 import { withDialog, WithDialogProps } from "~/store/dialog/with-dialog";
10
11 const mapDispatchToProps = (dispatch: Dispatch, props: WithDialogProps<any>) => ({
12     onConfirm: () => {
13         props.closeDialog();
14         dispatch<any>(removeCollectionsSelectedFiles());
15     }
16 });
17
18 export const [MultipleFilesRemoveDialog] = [ConfirmationDialog]
19     .map(connect(undefined, mapDispatchToProps))
20     .map(withDialog(MULTIPLE_FILES_REMOVE_DIALOG));