added side-panel-reducer file, minor code cleanup Arvados-DCO-1.1-Signed-off-by:...
[arvados.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 { 
9     KeepServicePanelRoot, 
10     KeepServicePanelRootDataProps, 
11     KeepServicePanelRootActionProps 
12 } from 'views/keep-service-panel/keep-service-panel-root';
13 import { openKeepServiceContextMenu } from 'store/context-menu/context-menu-actions';
14
15 const mapStateToProps = (state: RootState): KeepServicePanelRootDataProps => {
16     return {
17         keepServices: state.keepServices,
18         hasKeepSerices: state.keepServices.length > 0
19     };
20 };
21
22 const mapDispatchToProps = (dispatch: Dispatch): KeepServicePanelRootActionProps => ({
23     openRowOptions: (event, keepService) => {
24         dispatch<any>(openKeepServiceContextMenu(event, keepService));
25     }
26 });
27
28 export const KeepServicePanel = connect(mapStateToProps, mapDispatchToProps)(KeepServicePanelRoot);