"use client"; import { useState } from "react"; type Props = { text: string; className?: string; }; export function CopyButton({ text, className = "" }: Props) { const [copied, setCopied] = useState(false); const onClick = async () => { try { await navigator.clipboard.writeText(text); setCopied(true); setTimeout(() => setCopied(false), 1500); } catch { // Older browsers or denied permission — fail silently } }; return ( ); }