* B2B-36: add dashboard cards * B2B-36: add dashboard cards * card variants, some improvements, gen db types * add menus to home page * update db types * remove unnecessary card variant --------- Co-authored-by: Helena <helena@Helenas-MacBook-Pro.local>
21 lines
507 B
TypeScript
21 lines
507 B
TypeScript
import { type ClassValue, clsx } from 'clsx';
|
|
import { twMerge } from 'tailwind-merge';
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs));
|
|
}
|
|
|
|
export function toArray<T>(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(),
|
|
);
|
|
}
|