//
// SPDX-License-Identifier: AGPL-3.0
-import * as React from 'react';
+import React from 'react';
import { StyleRulesCallback, WithStyles, Typography, withStyles } from '@material-ui/core';
import { ArvadosTheme } from 'common/custom-theme';
import classNames from 'classnames';
lines: string[];
className?: string;
apiResponse?: boolean;
+ containerClassName?: string;
}
type CodeSnippetProps = CodeSnippetDataProps & WithStyles<CssRules>;
export const CodeSnippet = withStyles(styles)(
- ({ classes, lines, className, apiResponse }: CodeSnippetProps) =>
+ ({ classes, lines, className, containerClassName, apiResponse }: CodeSnippetProps) =>
<Typography
- component="div"
- className={classNames(classes.root, className)}>
- {
- lines.map((line: string, index: number) => {
+ component="div"
+ className={classNames(classes.root, containerClassName, className)}>
+ { lines.map((line: string, index: number) => {
return <Typography key={index} className={apiResponse ? classes.space : className} component="pre">{line}</Typography>;
- })
- }
+ }) }
</Typography>
);
\ No newline at end of file