mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-11 05:54:17 +00:00
23 lines
651 B
TypeScript
23 lines
651 B
TypeScript
import type { ClassValue } from "clsx";
|
|
import clsx from "clsx";
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
// Definition of custom classes you want to combine
|
|
const customClasses = new Map<string, string>([
|
|
["text-small", "text-small"],
|
|
["text-default-500", "text-default-500"],
|
|
// Add more custom classes as needed
|
|
]);
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
// Filter and combine custom classes before passing them to twMerge
|
|
const filteredInputs = inputs.map((input) => {
|
|
if (typeof input === "string") {
|
|
return customClasses.get(input) || input;
|
|
}
|
|
return input;
|
|
});
|
|
|
|
return twMerge(clsx(filteredInputs));
|
|
}
|