import React, { useRef, useState, RefObject } from 'react'; import { Clipboard, CheckMark } from '~/components'; import { InfoIcon } from 'lucide-react'; import { cn } from '~/utils/'; interface CodeBarProps { lang: string; codeRef: RefObject; plugin?: boolean; } const CodeBar: React.FC = React.memo(({ lang, codeRef, plugin = null }) => { const [isCopied, setIsCopied] = useState(false); return (
{lang} {plugin ? ( ) : ( )}
); }); interface CodeBlockProps { lang: string; codeChildren: string; classProp?: string; plugin?: boolean; } const CodeBlock: React.FC = ({ lang, codeChildren, classProp = '', plugin = null, }) => { const codeRef = useRef(null); const language = plugin ? 'json' : lang; return (
{codeChildren}
); }; export default CodeBlock;