import { useEffect, useState } from "react"; export default function ShareButton({ onShare }: { onShare?: () => void }) { const [copied, setCopied] = useState(false); useEffect(() => { if (copied) { const timeout = setTimeout(() => setCopied(false), 2000); return () => clearTimeout(timeout); } }, [copied]); return copied ? ( ) : ( ); }