blob: cbb30786f0eed89dab12808d8611c5da571b52ca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
import React from 'react';
import { ParserPropTypes } from './types';
import { Paper } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles';
const useStyles = makeStyles(theme => ({
root: {
background: theme.palette.background.default,
padding: theme.spacing(2),
overflowX: 'auto',
},
}));
const CodeBlock: React.FC<ParserPropTypes> = ({ rawLines }) => {
const classes = useStyles();
return (
<Paper variant="outlined" className={classes.root}>
{rawLines.map(line => <> {line} <br/> </>)}
</Paper>
);
}
export default CodeBlock;
|