'use client' import type { TrumpPost } from '@/types' function fmtPct(n: number | null | undefined) { if (n == null || isNaN(n)) return '—' const s = n.toFixed(2) + '%' return n >= 0 ? '+' + s : s } function timeAgo(iso: string) { const diff = Date.now() - new Date(iso).getTime() const m = Math.floor(diff / 60000) if (m < 1) return 'just now' if (m < 60) return m + 'm' const h = Math.floor(m / 60) if (h < 24) return h + 'h' return Math.floor(h / 24) + 'd' } function SourceIcon({ source }: { source: string }) { if (source === 'x') return
{post.text.slice(0, 180)}{post.text.length > 180 ? '…' : ''}