File size: 472 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// lazy load this file to keep initial bundle small

import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { vscDarkPlus as style } from 'react-syntax-highlighter/dist/cjs/styles/prism';
import React from 'react';

const CodeSnippet: React.FC<{
  code: string;
  language: string;
}> = ({ code, language }) => (
  <SyntaxHighlighter wrapLongLines language={language} style={style}>
    {code}
  </SyntaxHighlighter>
);

export default CodeSnippet;