add libraries to the docs (will probably re-design later)
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 2m36s

This commit is contained in:
Lee
2024-04-20 02:04:42 +01:00
parent 57a45a4c05
commit b4076c850a
10 changed files with 209 additions and 32 deletions

View File

@ -9,6 +9,11 @@ type CodeHighlighterProps = {
*/
code: string;
/**
* The language of the code.
*/
language?: string;
/**
* Should the element be rounded?
*/
@ -62,11 +67,11 @@ function rowRenderer({
});
}
export function CodeHighlighter({ code, rounded = true }: CodeHighlighterProps): ReactElement {
export function CodeHighlighter({ code, language = "json", rounded = true }: CodeHighlighterProps): ReactElement {
return (
<div className="text-xs md:text-md">
<SyntaxHighlighter
language="json"
language={language}
style={atomOneDark}
wrapLongLines
renderer={rowRenderer}