import React, { useState } from 'react'; import { cn } from '../../lib/utils'; import { HiCheck, HiClipboard } from 'react-icons/hi2'; import Typography from './Typography'; interface CopyFieldProps { label?: string; value: string; className?: string; } /** * Copy field component with integrated copy-to-clipboard functionality */ export const CopyField: React.FC = ({ label, value, className = '', }) => { const [isCopied, setIsCopied] = useState(false); const copyToClipboard = async () => { try { await navigator.clipboard.writeText(value); setIsCopied(true); setTimeout(() => setIsCopied(false), 2000); } catch (err) {} }; return (
{label && ( {label} )}
{value}
); }; export default CopyField;