B2B-36: add personal dashboard (#20)
* 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>
This commit is contained in:
13
lib/utils.ts
13
lib/utils.ts
@@ -1,5 +1,5 @@
|
||||
import { clsx, type ClassValue } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
import { type ClassValue, clsx } from 'clsx';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
@@ -9,3 +9,12 @@ 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(),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user