21 lines
418 B
TypeScript
21 lines
418 B
TypeScript
import { clsx, type ClassValue } from 'clsx';
|
|
import { twMerge } from 'tailwind-merge';
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs));
|
|
}
|
|
|
|
export const makeConditionalClassName = ({
|
|
context,
|
|
defaultClassName,
|
|
on = '',
|
|
off = '',
|
|
}: {
|
|
context: boolean;
|
|
defaultClassName: string;
|
|
on?: string;
|
|
off?: string;
|
|
}) => {
|
|
return defaultClassName + ' ' + (context ? on : off);
|
|
};
|