import React, { useEffect } from 'react'; import copyFn from 'copy-to-clipboard'; import { Files } from 'lucide-react'; import { Tooltip } from 'antd'; import cn from 'classnames'; import { useTranslation } from 'react-i18next'; export default function CodeBlock({ code = '', extra = '', language = 'javascript', copy = false, width = undefined, height = undefined, }) { const { t } = useTranslation(); useEffect(() => { setTimeout(() => { if (window.Prism) { Prism.highlightAll(); } }, 0); }, [code, language]); return (
{code}