2023-11-23 11:51:47 +00:00
|
|
|
import { clsx, type ClassValue } from "clsx";
|
|
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
|
2024-05-09 21:02:42 +00:00
|
|
|
export const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || "";
|
|
|
|
|
|
|
|
export const ADMIN_BASE_URL = process.env.NEXT_PUBLIC_ADMIN_BASE_URL || "";
|
|
|
|
export const ADMIN_BASE_PATH = process.env.NEXT_PUBLIC_ADMIN_BASE_PATH || "";
|
|
|
|
|
2024-05-14 17:21:07 +00:00
|
|
|
export const SPACE_BASE_URL = process.env.NEXT_PUBLIC_SPACE_BASE_URL || "";
|
2024-05-09 21:02:42 +00:00
|
|
|
export const SPACE_BASE_PATH = process.env.NEXT_PUBLIC_SPACE_BASE_PATH || "";
|
|
|
|
|
2024-05-22 12:01:56 +00:00
|
|
|
export const SUPPORT_EMAIL = process.env.NEXT_PUBLIC_SUPPORT_EMAIL || "";
|
|
|
|
|
2024-05-20 07:23:43 +00:00
|
|
|
export const GOD_MODE_URL = encodeURI(`${ADMIN_BASE_URL}${ADMIN_BASE_PATH}/`);
|
2024-05-16 06:05:31 +00:00
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
export const debounce = (func: any, wait: number, immediate: boolean = false) => {
|
|
|
|
let timeout: any;
|
2023-03-15 06:14:44 +00:00
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
return function executedFunction(...args: any) {
|
|
|
|
const later = () => {
|
|
|
|
timeout = null;
|
|
|
|
if (!immediate) func(...args);
|
|
|
|
};
|
|
|
|
|
|
|
|
const callNow = immediate && !timeout;
|
|
|
|
|
|
|
|
clearTimeout(timeout);
|
|
|
|
|
|
|
|
timeout = setTimeout(later, wait);
|
|
|
|
|
|
|
|
if (callNow) func(...args);
|
|
|
|
};
|
|
|
|
};
|
2023-09-13 14:51:02 +00:00
|
|
|
|
2023-11-23 11:51:47 +00:00
|
|
|
export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));
|