style: search models style

This commit is contained in:
jialin
2024-08-23 17:17:02 +08:00
parent 76444f28cb
commit a60be9c88f
24 changed files with 571 additions and 115 deletions
+9 -3
View File
@@ -1,16 +1,22 @@
import CodeViewer from './code-viewer';
import './style.less';
import CodeViewerLight from './code-viewer-light';
import './styles/index.less';
const HighlightCode: React.FC<{
code: string;
lang?: string;
copyable?: boolean;
theme?: 'light' | 'dark';
}> = (props) => {
const { code, lang = 'bash', copyable = true } = props;
const { code, lang = 'bash', copyable = true, theme = 'dark' } = props;
return (
<div className="high-light-wrapper">
<CodeViewer lang={lang} code={code} copyable={copyable} />
{theme === 'dark' ? (
<CodeViewer lang={lang} code={code} copyable={copyable} />
) : (
<CodeViewerLight lang={lang} code={code} copyable={copyable} />
)}
</div>
);
};