Add ssh keys panel
[arvados-workbench2.git] / src / views / ssh-key-panel / ssh-key-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 { SshKeyPanelRoot, SshKeyPanelRootDataProps, SshKeyPanelRootActionProps } from '~/views/ssh-key-panel/ssh-key-panel-root';
9 import { openSshKeyCreateDialog } from '~/store/auth/auth-action';
10
11 const mapStateToProps = (state: RootState): SshKeyPanelRootDataProps => {
12     return {
13         sshKeys: state.auth.sshKeys
14     };
15 };
16
17 const mapDispatchToProps = (dispatch: Dispatch): SshKeyPanelRootActionProps => ({
18     onClick: () => {
19         dispatch(openSshKeyCreateDialog());
20     }
21 });
22
23 export const SshKeyPanel = connect(mapStateToProps, mapDispatchToProps)(SshKeyPanelRoot);