'use client' import { useState } from 'react' const CopyIcon = () => ( ) const CheckIcon = () => ( ) export default function Code({ code }: { code: string }) { const [icon, setIcon] = useState(CopyIcon) const copy = async () => { await navigator?.clipboard?.writeText(code) setIcon(CheckIcon) setTimeout(() => setIcon(CopyIcon), 2000) } return (
      
      {code}
    
) }