X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/7ea39b36221b18b0243f10901c43e5fc8d41d88f..347b8e60a87c5c4f847fba0f644c7e0446098355:/src/components/code-snippet/code-snippet.tsx

diff --git a/src/components/code-snippet/code-snippet.tsx b/src/components/code-snippet/code-snippet.tsx
index bf9b6128..84271f0e 100644
--- a/src/components/code-snippet/code-snippet.tsx
+++ b/src/components/code-snippet/code-snippet.tsx
@@ -3,33 +3,39 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from 'react';
-import { StyleRulesCallback, WithStyles, Typography, withStyles, Theme } from '@material-ui/core';
+import { StyleRulesCallback, WithStyles, Typography, withStyles } from '@material-ui/core';
 import { ArvadosTheme } from '~/common/custom-theme';
+import * as classNames from 'classnames';
 
-type CssRules = 'root';
+type CssRules = 'root' | 'space';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     root: {
         boxSizing: 'border-box',
-        width: '100%',
-        height: '550px',
-        overflow: 'scroll',
+        overflow: 'auto',
         padding: theme.spacing.unit
+    },
+    space: {
+        marginLeft: '15px'
     }
 });
 
 export interface CodeSnippetDataProps {
     lines: string[];
+    className?: string;
+    apiResponse?: boolean;
 }
 
 type CodeSnippetProps = CodeSnippetDataProps & WithStyles<CssRules>;
 
 export const CodeSnippet = withStyles(styles)(
-    ({ classes, lines }: CodeSnippetProps) =>
-        <Typography component="div" className={classes.root}>
+    ({ classes, lines, className, apiResponse }: CodeSnippetProps) =>
+        <Typography 
+        component="div" 
+        className={classNames(classes.root, className)}>
             {
                 lines.map((line: string, index: number) => {
-                    return <Typography key={index} component="div">{line}</Typography>;
+                    return <Typography key={index} className={apiResponse ? classes.space : ''} component="pre">{line}</Typography>;
                 })
             }
         </Typography>
