import type React from 'react'; import { useState } from 'react'; interface CopyButtonProps { text: string; className?: string; /** "overlay" (default): absolute-positioned, hover-reveal (parent needs group relative). * "inline": normal flow, always visible, compact. */ variant?: 'overlay' | 'inline'; /** Optional label shown next to the icon (inline variant only). */ label?: string; } const CopyIcon = () => ( ); const CheckIcon = () => ( ); /** Copy-to-clipboard button with "Copied" flash. */ export const CopyButton: React.FC = ({ text, className = '', variant = 'overlay', label }) => { const [copied, setCopied] = useState(false); const handleCopy = async (e: React.MouseEvent) => { e.stopPropagation(); try { await navigator.clipboard.writeText(text); setCopied(true); setTimeout(() => setCopied(false), 1500); } catch { // Clipboard API may not be available } }; if (variant === 'inline') { return ( ); } return ( ); };