| import { type ClassValue, clsx } from "clsx"; | |
| import { twMerge } from "tailwind-merge"; | |
| export function cn(...inputs: ClassValue[]) { | |
| return twMerge(clsx(inputs)); | |
| } | |
| export function formatDate(dateString: string | null | undefined) { | |
| if (!dateString) return "Never"; | |
| return new Intl.DateTimeFormat("en-US", { | |
| month: "short", | |
| day: "numeric", | |
| hour: "numeric", | |
| minute: "numeric", | |
| }).format(new Date(dateString)); | |
| } | |
| export function formatDuration(ms: number | null | undefined) { | |
| if (ms == null) return "-"; | |
| if (ms < 1000) return `${ms}ms`; | |
| return `${(ms / 1000).toFixed(1)}s`; | |
| } | |