1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { RootState } from '~/store/store';
6 import { Dispatch } from 'redux';
7 import { connect } from 'react-redux';
9 ApiClientAuthorizationPanelRoot,
10 ApiClientAuthorizationPanelRootDataProps,
11 ApiClientAuthorizationPanelRootActionProps
12 } from '~/views/api-client-authorization-panel/api-client-authorization-panel-root';
13 import { openApiClientAuthorizationContextMenu } from '~/store/context-menu/context-menu-actions';
14 import { openApiClientAuthorizationsHelpDialog } from '~/store/api-client-authorizations/api-client-authorizations-actions';
16 const mapStateToProps = (state: RootState): ApiClientAuthorizationPanelRootDataProps => {
18 apiClientAuthorizations: state.apiClientAuthorizations,
19 hasApiClientAuthorizations: state.apiClientAuthorizations.length > 0
23 const mapDispatchToProps = (dispatch: Dispatch): ApiClientAuthorizationPanelRootActionProps => ({
24 openRowOptions: (event, apiClientAuthorization) => {
25 dispatch<any>(openApiClientAuthorizationContextMenu(event, apiClientAuthorization));
27 openHelpDialog: () => {
28 dispatch<any>(openApiClientAuthorizationsHelpDialog());
32 export const ApiClientAuthorizationPanel = connect(mapStateToProps, mapDispatchToProps)(ApiClientAuthorizationPanelRoot);