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',
18 padding: theme.spacing.unit
22 export interface CodeSnippetDataProps {
26 type CodeSnippetProps = CodeSnippetDataProps & WithStyles<CssRules>;
28 export const CodeSnippet = withStyles(styles)(
29 ({ classes, lines }: CodeSnippetProps) =>
30 <Typography component="div" className={classes.root}>
32 lines.map((line: string, index: number) => {
33 return <Typography key={index} component="pre">{line}</Typography>;