import { formatDistanceToNow } from "date-fns"; import { TrendingUp } from "lucide-react"; import { GradientIcon } from "~/components/ui/GradientIcon"; import { BRACKT_GRADIENT } from "~/lib/brand"; export interface ScoreEventEntry { id: string; teamId: string; teamName: string; ownerName: string | null; scoringEventId: string | null; scoringEventName: string | null; sportName: string | null; pointsDelta: string; occurredAt: Date | string; participants: Array<{ id: string; name: string }>; } interface RecentScoresCardProps { events: ScoreEventEntry[]; } function TimelineDot({ isRecent }: { isRecent: boolean }) { return (
); } function ScoreRow({ event, isLast, }: { event: ScoreEventEntry; isLast: boolean; }) { const pts = parseFloat(event.pointsDelta); const displayPts = Number.isInteger(pts) ? pts.toString() : pts.toFixed(1); const managerName = event.ownerName ?? event.teamName; const isRecent = Date.now() - new Date(event.occurredAt).getTime() < 24 * 60 * 60 * 1000; return (No recent scores yet — they'll appear here as events complete.
) : (