diff --git a/app/components/standings/RecentScoresCard.tsx b/app/components/standings/RecentScoresCard.tsx new file mode 100644 index 0000000..7e472e1 --- /dev/null +++ b/app/components/standings/RecentScoresCard.tsx @@ -0,0 +1,116 @@ +import { formatDistanceToNow } from "date-fns"; +import { TrendingUp } from "lucide-react"; +import { GradientIcon } from "~/components/ui/GradientIcon"; +import { BRACKT_GRADIENT } from "~/lib/brand"; + +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. +
+ ) : ( +No standings data yet.
-- Standings will appear once participants have results. -
-- Projected Points: Shows actual points from finished - participants plus expected value (EV) from remaining participants based - on their probability distributions. The "+X.X EV" indicates how many - additional points are expected from unfinished participants. -
-- Tiebreaker Rules: Teams are ranked by total - points. If tied, the team with more 1st place finishes ranks - higher. If still tied, 2nd place finishes are compared, then 3rd, - and so on through 8th place. -
-- Movement Indicators: Arrows (↑/↓) next to rank show rank changes - compared to 7 days ago. -
-- 7-Day Change: Shows points earned and rank movement - over the past 7 days. -
- {progressionData.chartData.length > 0 && ( -- Point Progression Chart: Visualizes how each team's - total points evolved over time based on {progressionData.chartData.length} day{progressionData.chartData.length !== 1 ? 's' : ''} of snapshot data. - {seasonComplete && " Use this to see how the final standings developed throughout the season."} -
- )} -