17782: Fixes almost all tests (4 left) mostly by fixing namespace-type imports.
[arvados-workbench2.git] / src / views / process-log-panel / process-log-panel-root.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import React from 'react';
6 import { Grid } from '@material-ui/core';
7 import { Process } from 'store/processes/process';
8 import { ProcessLogMainCard } from 'views/process-log-panel/process-log-main-card';
9 import { ProcessLogFormDataProps, ProcessLogFormActionProps } from 'views/process-log-panel/process-log-form';
10 import { DefaultView } from 'components/default-view/default-view';
11 import { ProcessIcon } from 'components/icon/icon';
12 import { CodeSnippetDataProps } from 'components/code-snippet/code-snippet';
13 import { ProcessLogMainCardActionProps } from './process-log-main-card';
14
15 export type ProcessLogPanelRootDataProps = {
16     process?: Process;
17 } & ProcessLogFormDataProps & CodeSnippetDataProps;
18
19 export type ProcessLogPanelRootActionProps = ProcessLogMainCardActionProps & ProcessLogFormActionProps;
20
21 export type ProcessLogPanelRootProps = ProcessLogPanelRootDataProps & ProcessLogPanelRootActionProps;
22
23 export const ProcessLogPanelRoot = (props: ProcessLogPanelRootProps) =>
24     props.process
25         ? <Grid container spacing={16}>
26             <ProcessLogMainCard 
27                 process={props.process} 
28                 {...props} />
29         </Grid> 
30         : <Grid container
31             alignItems='center'
32             justify='center'>
33             <DefaultView
34                 icon={ProcessIcon}
35                 messages={['Process Log not found']} />
36         </Grid>;