1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { Dispatch } from "redux";
6 import { connect } from "react-redux";
7 import { RootState } from '~/store/store';
8 import { openContextMenu, resourceKindToContextMenuKind } from '~/store/context-menu/context-menu-actions';
9 import { LinkPanelRoot, LinkPanelRootActionProps, LinkPanelRootDataProps } from '~/views/link-panel/link-panel-root';
10 import { ResourceKind } from '~/models/resource';
12 const mapStateToProps = (state: RootState): LinkPanelRootDataProps => {
14 resources: state.resources
18 const mapDispatchToProps = (dispatch: Dispatch): LinkPanelRootActionProps => ({
19 onContextMenu: (event, resourceUuid) => {
20 const kind = resourceKindToContextMenuKind(resourceUuid);
22 dispatch<any>(openContextMenu(event, {
26 kind: ResourceKind.LINK,
31 onItemClick: (resourceUuid: string) => { return; },
32 onItemDoubleClick: uuid => { return; }
35 export const LinkPanel = connect(mapStateToProps, mapDispatchToProps)(LinkPanelRoot);