"use client" import clsx from "clsx" import { Highlight, HighlightProps, themes } from "prism-react-renderer" import CopyButton from "../CopyButton" import IconCopy from "../Icons/Copy" import { useColorMode } from "../../providers/color-mode" export type CodeBlockProps = { source: string lang?: string className?: string collapsed?: boolean } & Omit const CodeBlock = ({ source, lang = "", className, collapsed = false, ...rest }: CodeBlockProps) => { const { colorMode } = useColorMode() return (
{({ className: preClassName, style, tokens, getLineProps, getTokenProps, }) => ( <>
               1 && "pt-1 pr-1",
                  tokens.length <= 1 && "py-0.5 px-1"
                )}
              >
                {tokens.map((line, i) => {
                  const lineProps = getLineProps({ line })
                  return (
                    
                      {tokens.length > 1 && (
                        
                          {i + 1}
                        
                      )}
                      
                        {line.map((token, key) => (
                          
                        ))}
                      
                    
                  )
                })}
              
            
)}
) } export default CodeBlock