mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
chore: move website and guide out of packages
This commit is contained in:
31
apps/website/src/components/SyntaxHighlighter.tsx
Normal file
31
apps/website/src/components/SyntaxHighlighter.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { PrismAsyncLight } from 'react-syntax-highlighter';
|
||||
import { vscDarkPlus, prism } from 'react-syntax-highlighter/dist/cjs/styles/prism';
|
||||
|
||||
export function SyntaxHighlighter({ language = 'typescript', code }: { code: string; language?: string }) {
|
||||
return (
|
||||
<>
|
||||
<div data-theme="dark">
|
||||
<PrismAsyncLight
|
||||
codeTagProps={{ style: { fontFamily: 'JetBrains Mono' } }}
|
||||
language={language}
|
||||
style={vscDarkPlus}
|
||||
wrapLines
|
||||
wrapLongLines
|
||||
>
|
||||
{code}
|
||||
</PrismAsyncLight>
|
||||
</div>
|
||||
<div data-theme="light">
|
||||
<PrismAsyncLight
|
||||
codeTagProps={{ style: { fontFamily: 'JetBrains Mono' } }}
|
||||
language={language}
|
||||
style={prism}
|
||||
wrapLines
|
||||
wrapLongLines
|
||||
>
|
||||
{code}
|
||||
</PrismAsyncLight>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user