diff --git a/frontend/src/components/CopyToClipboard.tsx b/frontend/src/components/CopyToClipboard.tsx index cbeec3dc..ddb01242 100644 --- a/frontend/src/components/CopyToClipboard.tsx +++ b/frontend/src/components/CopyToClipboard.tsx @@ -3,10 +3,19 @@ import { AlertTriangle, Check, Copy } from 'lucide-react'; interface CopyToClipboardProps { textToCopy: string; + /** Idle-state button label. Defaults to "Copy Output". */ + label?: string; + /** Native tooltip / accessible title. Defaults to "Copy to clipboard". */ + title?: string; } -const CopyToClipboard: React.FC = ({ textToCopy }) => { +const CopyToClipboard: React.FC = ({ + textToCopy, + label = 'Copy Output', + title = 'Copy to clipboard', +}) => { const [copyState, setCopyState] = useState<'idle' | 'copied' | 'error'>('idle'); + const hasText = Boolean(textToCopy); const handleCopy = async (): Promise => { if (!textToCopy) return; @@ -27,7 +36,7 @@ const CopyToClipboard: React.FC = ({ textToCopy }) => { }[copyState]; const buttonContent = { - idle: { icon: