Merge branch '15771-deleting-a-selection-of-files-fails'
[arvados.git] / src / views / process-log-panel / process-log-code-snippet.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import * as React from 'react';
6 import { MuiThemeProvider, createMuiTheme, StyleRulesCallback, withStyles, WithStyles } from '@material-ui/core/styles';
7 import { CodeSnippet } from '~/components/code-snippet/code-snippet';
8 import grey from '@material-ui/core/colors/grey';
9
10 type CssRules = 'codeSnippet';
11
12 const styles: StyleRulesCallback<CssRules> = () => ({
13     codeSnippet: {
14         maxHeight: '550px',
15     }
16 });
17
18 const theme = createMuiTheme({
19     overrides: {
20         MuiTypography: {
21             body2: {
22                 color: grey["200"]
23             },
24             root: {
25                 backgroundColor: '#000'
26             }
27         }
28     },
29     typography: {
30         fontFamily: 'monospace',
31         useNextVariants: true,
32     }
33 });
34
35 interface ProcessLogCodeSnippetProps {
36     lines: string[];
37 }
38
39 export const ProcessLogCodeSnippet = withStyles(styles)(
40     (props: ProcessLogCodeSnippetProps & WithStyles<CssRules>) =>
41         <MuiThemeProvider theme={theme}>
42             <CodeSnippet lines={props.lines} className={props.classes.codeSnippet} />
43         </MuiThemeProvider>);