File size: 574 Bytes
ce7e38e
1ccdda2
ce7e38e
 
 
 
1ccdda2
 
 
 
 
 
 
 
 
 
 
ce7e38e
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { oneDark } from "react-syntax-highlighter/dist/esm/styles/prism";
import { vscDarkPlus } from "react-syntax-highlighter/dist/esm/styles/prism";

export default function CodeBlock({ code }) {
  return (
    <SyntaxHighlighter
      language="javascript" // fallback default
      style={oneDark}
      showLineNumbers
      wrapLines
      customStyle={{
        fontSize: "0.9rem",
        borderRadius: "8px",
        padding: "1em",
      }}
    >
      {code}
    </SyntaxHighlighter>
  );
}