1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import { StyleRulesCallback, WithStyles, Typography, withStyles, Theme } from '@material-ui/core';
7 import { ArvadosTheme } from '~/common/custom-theme';
9 type CssRules = 'root';
11 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
13 boxSizing: 'border-box',
17 padding: theme.spacing.unit
21 export interface CodeSnippetDataProps {
25 type CodeSnippetProps = CodeSnippetDataProps & WithStyles<CssRules>;
27 export const CodeSnippet = withStyles(styles)(
28 ({ classes, lines }: CodeSnippetProps) =>
29 <Typography component="div" className={classes.root}>
31 lines.map((line: string, index: number) => {
32 return <Typography key={index} component="div">{line}</Typography>;