Template
Next.js 16 + React 19 storefront template with Shopify Storefront API integration, Tailwind v4, and shadcn/ui components. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0111qSr3KopyGRsJ6LznR1xZ
13 lines
354 B
TypeScript
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() + '...';
|
|
}
|