import React from 'react'; import type { Language } from 'prism-react-renderer'; import Highlight, { defaultProps } from 'prism-react-renderer'; import { useCopy } from 'dumi/theme'; import 'prismjs/themes/prism.css'; import './SourceCode.less'; export interface ICodeBlockProps { code: string; lang: Language; showCopy?: boolean; } export default ({ code, lang, showCopy = true }: ICodeBlockProps) => { const [copyCode, copyStatus] = useCopy(); return (
{showCopy && ()}