Merge branch 'master' of git.curoverse.com:arvados-workbench2 into 14503_keep_service...
[arvados-workbench2.git] / src / views / keep-service-panel / keep-service-panel.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { RootState } from '~/store/store';
6 import { Dispatch } from 'redux';
7 import { connect } from 'react-redux';
8 import { } from '~/store/keep-services/keep-services-actions';
9 import { 
10     KeepServicePanelRoot, 
11     KeepServicePanelRootDataProps, 
12     KeepServicePanelRootActionProps 
13 } from '~/views/keep-service-panel/keep-service-panel-root';
14 import { openKeepServiceContextMenu } from '~/store/context-menu/context-menu-actions';
15
16 const mapStateToProps = (state: RootState): KeepServicePanelRootDataProps => {
17     return {
18         keepServices: state.keepServices,
19         hasKeepSerices: state.keepServices.length > 0
20     };
21 };
22
23 const mapDispatchToProps = (dispatch: Dispatch): KeepServicePanelRootActionProps => ({
24     openRowOptions: (event, index, keepService) => {
25         dispatch<any>(openKeepServiceContextMenu(event, index, keepService));
26     }
27 });
28
29 export const KeepServicePanel = connect(mapStateToProps, mapDispatchToProps)(KeepServicePanelRoot);