1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { connect } from "react-redux";
6 import { RootState } from "../../../store/store";
7 import { DownloadAction } from "./download-action";
8 import { getNodeValue } from "../../../models/tree";
9 import { CollectionFileType } from "../../../models/collection-file";
11 const mapStateToProps = (state: RootState) => {
12 const { resource } = state.contextMenu;
14 const file = getNodeValue(resource.uuid)(state.collectionPanelFiles);
18 download: file.type === CollectionFileType.DIRECTORY ? undefined : file.name
25 export const DownloadCollectionFileAction = connect(mapStateToProps)(DownloadAction);