'use client'; import { useState } from 'react'; import { Check, Copy } from 'lucide-react'; import { cn } from '@/lib/cn'; export function CopyButton({ value, label = 'Copy', className, }: { value: string; label?: string; className?: string; }) { const [copied, setCopied] = useState(false); async function copy() { try { await navigator.clipboard.writeText(value); setCopied(true); setTimeout(() => setCopied(false), 2000); } catch { // Clipboard unavailable (insecure context) — ignore. } } return ( ); }