import { type ClassValue, clsx } from 'clsx'; import { twMerge } from 'tailwind-merge'; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } export function toArray(input?: T | T[] | null): T[] { if (!input) return []; return Array.isArray(input) ? input : [input]; } export function toTitleCase(str?: string) { if (!str) return ''; return str.replace( /\w\S*/g, (text: string) => text.charAt(0).toUpperCase() + text.substring(1).toLowerCase(), ); }