import type { Achievement, Challenge, FanProfile, Match, Memory, PassportStats, ScreenId, Stadium, Sticker, Team, } from "../../types/passport"; import { formatCompactNumber, formatMatchDate, getStadiumById, getTeamById, } from "../../utils/passportMetrics"; import MetricCard from "../shared/MetricCard"; import ProgressBar from "../shared/ProgressBar"; import StatusPill from "../shared/StatusPill"; interface DashboardScreenProps { profile: FanProfile; stats: PassportStats; teams: Team[]; stadiums: Stadium[]; matches: Match[]; stickers: Sticker[]; achievements: Achievement[]; memories: Memory[]; challenges: Challenge[]; onNavigate: (screen: ScreenId) => void; } export default function DashboardScreen({ profile, stats, teams, stadiums, matches, stickers, achievements, memories, challenges, onNavigate, }: DashboardScreenProps) { const favoriteTeam = getTeamById(teams, profile.favoriteTeamId); const nextMatches = matches.filter((match) => match.status !== "completed").slice(0, 3); const featuredChallenges = challenges.filter((challenge) => challenge.featured).slice(0, 3); const recentMemories = memories.slice(0, 3); const latestStickers = stickers.filter((sticker) => sticker.obtained).slice(0, 4); const unlockedAchievements = achievements.filter((achievement) => achievement.unlocked).slice(0, 3); return (

Today in your passport

Welcome back, {profile.displayName}.

Your {favoriteTeam?.name ?? "favourite team"} journey is active, the daily trivia streak is alive, and new collection stamps are waiting.

Daily missions

Challenges that bring fans back

{stats.currentStreak}-day streak
{featuredChallenges.map((challenge) => ( ))}

Match journey

Next passport stamps

{nextMatches.map((match) => { const homeTeam = getTeamById(teams, match.homeTeamId); const awayTeam = getTeamById(teams, match.awayTeamId); const stadium = getStadiumById(stadiums, match.venueId); return (
{match.status} {formatMatchDate(match.dateTime, "long")}
{homeTeam?.flagEmoji} {homeTeam?.shortName} vs {awayTeam?.shortName} {awayTeam?.flagEmoji}

{stadium?.name}

); })}
); }