1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import 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 import { ArvadosTheme } from 'common/custom-theme';
11 type CssRules = 'codeSnippet' | 'codeSnippetContainer';
13 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
16 codeSnippetContainer: {
17 height: `calc(100% - ${theme.spacing.unit * 4}px)`, // so that horizontal scollbar is visible
21 const theme = createMuiTheme({
28 backgroundColor: '#000'
33 fontFamily: 'monospace',
34 useNextVariants: true,
38 interface ProcessLogCodeSnippetProps {
42 export const ProcessLogCodeSnippet = withStyles(styles)(
43 (props: ProcessLogCodeSnippetProps & WithStyles<CssRules>) =>
44 <MuiThemeProvider theme={theme}>
45 <CodeSnippet lines={props.lines} className={props.classes.codeSnippet}
46 containerClassName={props.classes.codeSnippetContainer} />