feat: API access key management #2846 (#2865)

### What problem does this PR solve?

feat: API access key management #2846
feat: Render markdown file with remark-loader #2846

### Type of change

- [ ] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):
This commit is contained in:
balibabu
2024-10-16 15:57:39 +08:00
committed by GitHub
parent 4991107822
commit e5d3ab0332
32 changed files with 1303 additions and 165 deletions

View File

@ -1,6 +1,6 @@
import classNames from 'classnames';
import Markdown from 'react-markdown';
import SyntaxHighlighter from 'react-syntax-highlighter';
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import rehypeRaw from 'rehype-raw';
import remarkGfm from 'remark-gfm';
@ -22,11 +22,16 @@ const HightLightMarkdown = ({
const { children, className, node, ...rest } = props;
const match = /language-(\w+)/.exec(className || '');
return match ? (
<SyntaxHighlighter {...rest} PreTag="div" language={match[1]}>
<SyntaxHighlighter
{...rest}
PreTag="div"
language={match[1]}
// style={dark}
>
{String(children).replace(/\n$/, '')}
</SyntaxHighlighter>
) : (
<code {...rest} className={className}>
<code {...rest} className={`${className} ${styles.code}`}>
{children}
</code>
);