import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';

/**
 * Utility for conditionally combining Tailwind CSS classes.
 * Combines clsx for conditional classes and tailwind-merge for deduplication.
 *
 * @example
 * cn('px-4 py-2', isActive && 'bg-blue-500', className)
 * cn('text-sm text-gray-500', { 'font-bold': isBold })
 */
export function cn(...inputs: ClassValue[]): string {
  return twMerge(clsx(inputs));
}
