export function timeAgo(iso: string): string { const now = Date.now() const then = new Date(iso).getTime() const diff = Math.floor((now - then) / 1000) if (diff < 60) return 'just now' if (diff < 3600) { const m = Math.floor(diff / 60) return `${m} minute${m !== 1 ? 's' : ''} ago` } if (diff < 86400) { const h = Math.floor(diff / 3600) return `${h} hour${h !== 1 ? 's' : ''} ago` } const d = Math.floor(diff / 86400) return `${d} day${d !== 1 ? 's' : ''} ago` }