-
-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathutils.ts
More file actions
19 lines (15 loc) · 605 Bytes
/
utils.ts
File metadata and controls
19 lines (15 loc) · 605 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import urls from 'constants/url';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
const isProduction = process.env.NODE_ENV === 'production';
export const getRedirectUrl = () => {
let url = process?.env?.NEXT_PUBLIC_SITE_URL ?? urls.app.overview;
// Make sure to include `https://` when not localhost.
url = isProduction ? `https:${url}` : `http://app.${url}`;
// Make sure to including trailing `/`.
url = url.charAt(url.length - 1) === '/' ? url : `${url}/`;
return url;
};