feat: vllm support

This commit is contained in:
jialin
2024-09-25 16:17:25 +08:00
parent 0652f850d6
commit 3cd96ba2e8
47 changed files with 1610 additions and 252 deletions
+23 -5
View File
@@ -1,3 +1,4 @@
import React from 'react';
import CodeViewerDark from './code-viewer-dark';
import CodeViewerLight from './code-viewer-light';
import './styles/index.less';
@@ -7,18 +8,35 @@ const HighlightCode: React.FC<{
lang?: string;
copyable?: boolean;
theme?: 'light' | 'dark';
height?: string | number;
}> = (props) => {
const { code, lang = 'bash', copyable = true, theme = 'dark' } = props;
const {
code,
lang = 'bash',
copyable = true,
theme = 'dark',
height = 'auto'
} = props;
return (
<div className="high-light-wrapper">
<div className="high-light-wrapper hj-wrapper">
{theme === 'dark' ? (
<CodeViewerDark lang={lang} code={code} copyable={copyable} />
<CodeViewerDark
lang={lang}
code={code}
copyable={copyable}
height={height}
/>
) : (
<CodeViewerLight lang={lang} code={code} copyable={copyable} />
<CodeViewerLight
lang={lang}
code={code}
copyable={copyable}
height={height}
/>
)}
</div>
);
};
export default HighlightCode;
export default React.memo(HighlightCode);