'use client' import { CopyButton } from './CopyButton' import { getTextContent } from '@/lib/react-node-text' type CodeWrapperProps = { language?: string children?: React.ReactNode } export function CodeWrapper({ language, children }: CodeWrapperProps) { const text = getTextContent(children).replace(/\n$/, '') const lineCount = text.length === 0 ? 1 : text.split('\n').length return (
{Array.from({ length: lineCount }, (_, i) => ( {i + 1} ))}
          {children}
        
) }