refs #14801-api-resonse-is-not-complete
[arvados-workbench2.git] / src / components / code-snippet / code-snippet.tsx
index a23a5fe20e185a5f51971f5781be4083a3b6153f..84271f0ea3be2cbda6e364fd574f28adabd39aab 100644 (file)
@@ -7,31 +7,35 @@ import { StyleRulesCallback, WithStyles, Typography, withStyles } from '@materia
 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',
         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, className }: CodeSnippetProps) =>
+    ({ classes, lines, className, apiResponse }: CodeSnippetProps) =>
         <Typography 
         component="div" 
         className={classNames(classes.root, className)}>
             {
                 lines.map((line: string, index: number) => {
-                    return <Typography key={index} component="pre">{line}</Typography>;
+                    return <Typography key={index} className={apiResponse ? classes.space : ''} component="pre">{line}</Typography>;
                 })
             }
         </Typography>