diff options
Diffstat (limited to 'src/lib/Markdown/CodeBlock.tsx')
-rw-r--r-- | src/lib/Markdown/CodeBlock.tsx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/lib/Markdown/CodeBlock.tsx b/src/lib/Markdown/CodeBlock.tsx new file mode 100644 index 0000000..5b8edec --- /dev/null +++ b/src/lib/Markdown/CodeBlock.tsx @@ -0,0 +1,27 @@ +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(1), + overflowX: 'auto', + fontFamily: 'Monospace', + scrollbarColor: 'auto' + }, +})); + +const CodeBlock: React.FC<ParserPropTypes> = ({ rawLines }) => { + const classes = useStyles(); + return ( + <Paper variant="outlined" className={classes.root}> + {rawLines.map(line => <pre>{line}</pre>)} + </Paper> + ); +} + +export default CodeBlock; + |