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 } from '@material-ui/core';
7 import { ArvadosTheme } from '~/common/custom-theme';
8 import * as classNames from 'classnames';
10 type CssRules = 'root';
12 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
14 boxSizing: 'border-box',
16 padding: theme.spacing.unit
20 export interface CodeSnippetDataProps {
25 type CodeSnippetProps = CodeSnippetDataProps & WithStyles<CssRules>;
27 export const CodeSnippet = withStyles(styles)(
28 ({ classes, lines, className }: CodeSnippetProps) =>
31 className={classNames(classes.root, className)}>
33 lines.map((line: string, index: number) => {
34 return <Typography key={index} component="pre">{line}</Typography>;