import { useState } from "react"; import { Button } from "@/components/ui/button"; import { Copy, Check } from "lucide-react"; import { toast } from "sonner"; async function copyToClipboard(text: string): Promise { try { await navigator.clipboard.writeText(text); return true; } catch { return false; } } /** An icon button that copies `value`, with its own brief checkmark * confirmation - no toast on success, just the icon swap, so copying * several fields in a row doesn't stack toasts. */ export function CopyButton({ value, label, className }: { value: string; label: string; className?: string }) { const [copied, setCopied] = useState(false); return ( ); }