'use client'; import { cn } from '@/lib/utils/cn'; import { Check, Copy } from 'lucide-react'; import { useState } from 'react'; import { toast } from 'sonner'; interface ColorSwatchProps { color: string; size?: 'sm' | 'md' | 'lg'; showLabel?: boolean; onClick?: () => void; className?: string; } export function ColorSwatch({ color, size = 'md', showLabel = true, onClick, className }: ColorSwatchProps) { const [copied, setCopied] = useState(false); const handleClick = () => { if (onClick) { onClick(); return; } navigator.clipboard.writeText(color); setCopied(true); toast.success(`Copied ${color}`); setTimeout(() => setCopied(false), 1500); }; return ( ); }