Files
shopify-react-editor-template/lib/utils.ts
T
2026-08-09 16:00:10 -04:00

13 lines
354 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(str: string, maxLength: number): string {
if (!str) return '';
if (str.length <= maxLength) return str;
return str.slice(0, maxLength).trim() + '...';
}