Files
stats/apps/dashboard/src/components/Syntax.tsx
2024-03-11 13:15:44 +01:00

20 lines
500 B
TypeScript

'use client';
import { Light as SyntaxHighlighter } from 'react-syntax-highlighter';
import ts from 'react-syntax-highlighter/dist/cjs/languages/hljs/typescript';
import docco from 'react-syntax-highlighter/dist/cjs/styles/hljs/docco';
SyntaxHighlighter.registerLanguage('typescript', ts);
interface SyntaxProps {
code: string;
}
export default function Syntax({ code }: SyntaxProps) {
return (
<SyntaxHighlighter wrapLongLines style={docco}>
{code}
</SyntaxHighlighter>
);
}