mirror of
https://github.com/Xevion/dynamic-preauth.git
synced 2025-12-11 00:07:09 -06:00
21 lines
605 B
TypeScript
21 lines
605 B
TypeScript
import { clsx, type ClassValue } from "clsx";
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
export { type ClassValue };
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs));
|
|
}
|
|
|
|
export function plural(text: string, count: number) {
|
|
return `${text}${count === 1 ? "" : "s"}`;
|
|
}
|
|
|
|
export type Platform = "windows" | "mac" | "linux";
|
|
|
|
export function os(): Platform | "other" {
|
|
if (navigator.userAgent.includes("win")) return "windows";
|
|
else if (navigator.userAgent.includes("mac")) return "mac";
|
|
else if (navigator.userAgent.includes("linux")) return "linux";
|
|
return "other";
|
|
}
|