init: push source

This commit is contained in:
Mufeed VH
2025-06-19 19:24:01 +05:30
commit 8e76d016d4
136 changed files with 38177 additions and 0 deletions

17
src/lib/utils.ts Normal file
View File

@@ -0,0 +1,17 @@
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
/**
* Combines multiple class values into a single string using clsx and tailwind-merge.
* This utility function helps manage dynamic class names and prevents Tailwind CSS conflicts.
*
* @param inputs - Array of class values that can be strings, objects, arrays, etc.
* @returns A merged string of class names with Tailwind conflicts resolved
*
* @example
* cn("px-2 py-1", condition && "bg-blue-500", { "text-white": isActive })
* // Returns: "px-2 py-1 bg-blue-500 text-white" (when condition and isActive are true)
*/
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}