178db25c222878339d456913d0f647e6916a5659
[arvados-workbench2.git] / src / views / main-panel / main-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 { connect } from 'react-redux';
7 import { MainPanelRoot, MainPanelRootDataProps } from '~/views/main-panel/main-panel-root';
8 import { isSystemWorking } from '~/store/progress-indicator/progress-indicator-reducer';
9 import { isWorkbenchLoading } from '~/store/workbench/workbench-actions';
10 import { LinkAccountPanelStatus } from '~/store/link-account-panel/link-account-panel-reducer';
11
12 const mapStateToProps = (state: RootState): MainPanelRootDataProps => {
13     return {
14         user: state.auth.user,
15         working: isSystemWorking(state.progressIndicator),
16         loading: isWorkbenchLoading(state),
17         buildInfo: state.appInfo.buildInfo,
18         uuidPrefix: state.auth.localCluster,
19         isNotLinking: state.linkAccountPanel.status === LinkAccountPanelStatus.INITIAL
20     };
21 };
22
23 const mapDispatchToProps = null;
24
25 export const MainPanel = connect(mapStateToProps, mapDispatchToProps)(MainPanelRoot);