12 lines
333 B
TypeScript
12 lines
333 B
TypeScript
import { clsx, type ClassValue } from "clsx";
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs));
|
|
}
|
|
|
|
export function truncate(text: string, max = 80): string {
|
|
if (!text) return "";
|
|
return text.length > max ? text.slice(0, max - 1).trimEnd() + "…" : text;
|
|
}
|