1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
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 import { matchLinkAccountRoute } from '~/routes/routes';
13 const mapStateToProps = (state: RootState): MainPanelRootDataProps => {
15 user: state.auth.user,
16 working: isSystemWorking(state.progressIndicator),
17 loading: isWorkbenchLoading(state),
18 buildInfo: state.appInfo.buildInfo,
19 uuidPrefix: state.auth.localCluster,
20 isNotLinking: state.linkAccountPanel.status === LinkAccountPanelStatus.NONE || state.linkAccountPanel.status === LinkAccountPanelStatus.INITIAL,
21 isLinkingPath: state.router.location ? matchLinkAccountRoute(state.router.location.pathname) !== null : false,
22 siteBanner: state.config.clusterConfig.Workbench.SiteName
26 const mapDispatchToProps = null;
28 export const MainPanel = connect(mapStateToProps, mapDispatchToProps)(MainPanelRoot);