'use client'; import { Activity, Award, Calendar, ChevronRight, Clock, Flag, Medal, Play, Star, Target, Trophy, UserPlus, Users, } from 'lucide-react'; import Image from 'next/image'; import Link from 'next/link'; import { FeedItemRow } from '@/components/dashboard/FeedItemRow'; import { FriendItem } from '@/components/dashboard/FriendItem'; import { LeagueStandingItem } from '@/components/dashboard/LeagueStandingItem'; import { StatCard } from '@/components/dashboard/StatCard'; import { UpcomingRaceItem } from '@/components/dashboard/UpcomingRaceItem'; import Button from '@/components/ui/Button'; import Card from '@/components/ui/Card'; import { getCountryFlag } from '@/lib/utilities/country'; import { getGreeting, timeUntil } from '@/lib/utilities/time'; import { DashboardOverviewViewModel } from '@/lib/view-models/DashboardOverviewViewModel'; interface DashboardTemplateProps { data: DashboardOverviewViewModel; } export function DashboardTemplate({ data }: DashboardTemplateProps) { const currentDriver = data.currentDriver; const nextRace = data.nextRace; const upcomingRaces = data.upcomingRaces; const leagueStandingsSummaries = data.leagueStandings; const feedSummary = { items: data.feedItems }; const friends = data.friends; const activeLeaguesCount = data.activeLeaguesCount; const { totalRaces, wins, podiums, rating, globalRank, consistency } = currentDriver; return (
{/* Hero Section */}
{/* Background Pattern */}
{/* Welcome Message */}
{currentDriver.name}

{getGreeting()},

{currentDriver.name} {getCountryFlag(currentDriver.country)}

{rating}
#{globalRank}
{totalRaces} races completed
{/* Quick Actions */}
{/* Quick Stats Row */}
{/* Main Content */}
{/* Left Column - Main Content */}
{/* Next Race Card */} {nextRace && (
Next Race
{nextRace.isMyLeague && ( Your League )}

{nextRace.track}

{nextRace.car}

{nextRace.scheduledAt.toLocaleDateString('en-US', { weekday: 'long', month: 'short', day: 'numeric', })} {nextRace.scheduledAt.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', })}

Starts in

{timeUntil(nextRace.scheduledAt)}

)} {/* League Standings Preview */} {leagueStandingsSummaries.length > 0 && (

Your Championship Standings

View all
{leagueStandingsSummaries.map((summary: any) => ( ))}
)} {/* Activity Feed */}

Recent Activity

{feedSummary.items.length > 0 ? (
{feedSummary.items.slice(0, 5).map((item: any) => ( ))}
) : (

No activity yet

Join leagues and add friends to see activity here

)}
{/* Right Column - Sidebar */}
{/* Upcoming Races */}

Upcoming Races

View all
{upcomingRaces.length > 0 ? (
{upcomingRaces.slice(0, 5).map((race: any) => ( ))}
) : (

No upcoming races

)}
{/* Friends */}

Friends

{friends.length} friends
{friends.length > 0 ? (
{friends.slice(0, 6).map((friend: any) => ( ))} {friends.length > 6 && ( +{friends.length - 6} more )}
) : (

No friends yet

)}
); }