import Image from 'next/image' import { useState, useEffect } from 'react' import copyImg from '@assets/icons/copy.png' export const CopyTitle = ({ title, className, }: { title: string className?: string }) => { const [copy, setCopy] = useState(false) useEffect(() => { const timeId = setTimeout(() => { setCopy(false) }, 3000) return () => { clearTimeout(timeId) } }, [copy]) const handleCopy = () => { navigator.clipboard.writeText(title) setCopy(true) } return (

{ handleCopy() }} > {title}{' '}

{ handleCopy() }} src={copyImg} alt="copy img" className={ 'transition-all ease-in-out ml-2 mt-[11px] w-[15px] h-fit inverted cursor-pointer' } /> copied
) }