'use client' import { cn } from '@thedaviddias/design-system/lib/utils' import { Check, Copy } from 'lucide-react' import { useState } from 'react' interface CopyButtonProps { text: string variant?: 'default' | 'terminal' } /** * Renders a button that copies text to the clipboard */ export function CopyButton({ text, variant = 'default' }: CopyButtonProps) { const [copied, setCopied] = useState(false) /** * Copies the text to the clipboard and shows a confirmation */ const handleCopy = () => { navigator.clipboard.writeText(text) setCopied(true) setTimeout(() => setCopied(false), 2000) } return ( ) }