www/lib/utils.ts
2024-07-01 11:11:56 -04:00

8 lines
307 B
TypeScript

type ClassValue = string | number | boolean | undefined | null;
type ClassArray = ClassValue[];
type ClassDictionary = Record<string, any>;
type ClassProp = ClassValue | ClassArray | ClassDictionary;
export function cn(...inputs: ClassProp[]): string {
return inputs.flat().filter(Boolean).join(' ');
}