1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import { StyleRulesCallback, WithStyles, withStyles, Grid, LinearProgress } from '@material-ui/core';
7 import { User } from "~/models/user";
8 import { ArvadosTheme } from '~/common/custom-theme';
9 import { WorkbenchPanel } from '~/views/workbench/workbench';
10 import { LoginPanel } from '~/views/login-panel/login-panel';
11 import { WorkbenchLoadingScreen } from '~/views/workbench/workbench-loading-screen';
12 import { MainAppBar } from '~/views-components/main-app-bar/main-app-bar';
14 type CssRules = 'root';
16 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
24 export interface MainPanelRootDataProps {
31 type MainPanelRootProps = MainPanelRootDataProps & WithStyles<CssRules>;
33 export const MainPanelRoot = withStyles(styles)(
34 ({ classes, loading, working, user, buildInfo }: MainPanelRootProps) =>
36 ? <WorkbenchLoadingScreen />
40 buildInfo={buildInfo}>
41 {working ? <LinearProgress color="secondary" /> : null}
43 <Grid container direction="column" className={classes.root}>
44 {user ? <WorkbenchPanel /> : <LoginPanel />}