13 lines
368 B
TypeScript
13 lines
368 B
TypeScript
import { type ClassValue, clsx } from "clsx";
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs));
|
|
}
|
|
|
|
export const hasRole = (userRoles: string[], acceptedRoles = []) => {
|
|
const contains = userRoles.some((r) => acceptedRoles.indexOf(r) !== -1);
|
|
if (contains) return true;
|
|
else return false;
|
|
};
|