import { FC } from 'react'; import SyntaxHighlighter from 'react-syntax-highlighter'; import { gruvboxDark } from 'react-syntax-highlighter/dist/cjs/styles/hljs'; const Code: FC = ({ node, inline, className, children, ...props }) => { const match = /language-(\w+)/.exec(className || '') return !inline && match ? ( {String(children).replace(/\n$/, '')} ) : ( {children} ); } export default Code;