2025-07-10 15:45:26 -07:00
|
|
|
import { type ClassValue, clsx } from "clsx";
|
2025-05-28 12:26:47 -07:00
|
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
|
|
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
|
|
|
return twMerge(clsx(inputs));
|
|
|
|
|
}
|
2025-07-10 15:45:26 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Utility function to get a cookie value by name from the client-side
|
|
|
|
|
*/
|
|
|
|
|
export function getCookie(name: string): string | null {
|
|
|
|
|
if (typeof document === "undefined") {
|
|
|
|
|
return null; // Return null during SSR
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const value = `; ${document.cookie}`;
|
|
|
|
|
const parts = value.split(`; ${name}=`);
|
|
|
|
|
if (parts.length === 2) {
|
|
|
|
|
return parts.pop()?.split(";").shift() || null;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|