diff options
author | eug-vs <eug-vs@keemail.me> | 2021-01-07 13:22:21 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2021-01-07 15:17:43 +0300 |
commit | f5c21698a09d9214f57ce6dab2595f3d61e1ff11 (patch) | |
tree | 900b605f147a5a024377b42be16a6f677a10a387 /src/lib/Markdown/CodeBlock.tsx | |
parent | afa7e4abe02959798665949193d832907d97153a (diff) | |
download | react-benzin-f5c21698a09d9214f57ce6dab2595f3d61e1ff11.tar.gz |
feat!: use react-markdown
Diffstat (limited to 'src/lib/Markdown/CodeBlock.tsx')
-rw-r--r-- | src/lib/Markdown/CodeBlock.tsx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/lib/Markdown/CodeBlock.tsx b/src/lib/Markdown/CodeBlock.tsx index 394458e..7431881 100644 --- a/src/lib/Markdown/CodeBlock.tsx +++ b/src/lib/Markdown/CodeBlock.tsx @@ -1,8 +1,9 @@ import React from 'react'; -import { Paper } from '@material-ui/core'; +import { Paper, makeStyles } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; -import { ParserPropTypes } from './types'; +interface PropTypes { + value: string; +} const useStyles = makeStyles(theme => ({ root: { @@ -14,11 +15,13 @@ const useStyles = makeStyles(theme => ({ }, })); -const CodeBlock: React.FC<ParserPropTypes> = ({ rawLines }) => { +const CodeBlock: React.FC<PropTypes> = ({ value }) => { const classes = useStyles(); return ( <Paper variant="outlined" className={classes.root}> - {rawLines.map(line => <pre>{line}</pre>)} + <pre> + {value} + </pre> </Paper> ); }; |