import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); }
export function timeAgo(date: string | Date) {
const s = Math.floor((Date.now() - new Date(date).getTime())/1000);
if (s < 60) return "just now";
if (s < 3600) return `${Math.floor(s/60)}m ago`;
if (s < 86400) return `${Math.floor(s/3600)}h ago`;
if (s < 2592000) return `${Math.floor(s/86400)}d ago`;
return new Date(date).toLocaleDateString();
}