blob: 485c70b6f6df3dcae43e4e34b82269826903be8f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { vscDarkPlus as highlightStyle } from "react-syntax-highlighter/dist/esm/styles/prism";
interface StyledCodeProps {
children: string;
language?: string;
}
const StyledCode = (props: StyledCodeProps) => (
<SyntaxHighlighter
customStyle={{ margin: "0" }}
style={highlightStyle}
language={props.language || "python"}
>
{(props.children as any).props.children}
</SyntaxHighlighter>
);
export default StyledCode;
|