Files
react-editor-shopify-nextjs/lib/utils.ts
2026-06-06 11:45:24 -04:00

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;
}