This commit is contained in:
2025-03-06 20:50:31 +01:00
commit 4a1397651f
68 changed files with 10049 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export function generateSlug(title: string) {
return title.toLowerCase().replace(/\s+/g, "-");
}
export function debounce<T extends (...args: any[]) => void>(
func: T,
delay: number,
): (...args: Parameters<T>) => void {
let timeoutId: ReturnType<typeof setTimeout>;
return (...args: Parameters<T>) => {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => func(...args), delay);
};
}