'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 } from '@/lib/utilities/time'; interface DashboardViewData { currentDriver: { name: string; avatarUrl: string; country: string; rating: string; rank: string; totalRaces: string; wins: string; podiums: string; consistency: string; }; nextRace: { id: string; track: string; car: string; scheduledAt: string; formattedDate: string; formattedTime: string; timeUntil: string; isMyLeague: boolean; } | null; upcomingRaces: Array<{ id: string; track: string; car: string; scheduledAt: string; formattedDate: string; formattedTime: string; timeUntil: string; isMyLeague: boolean; }>; leagueStandings: Array<{ leagueId: string; leagueName: string; position: string; points: string; totalDrivers: string; }>; feedItems: Array<{ id: string; type: string; headline: string; body?: string; timestamp: string; formattedTime: string; ctaHref?: string; ctaLabel?: string; }>; friends: Array<{ id: string; name: string; avatarUrl: string; country: string; }>; activeLeaguesCount: string; friendCount: string; hasUpcomingRaces: boolean; hasLeagueStandings: boolean; hasFeedItems: boolean; hasFriends: boolean; } interface DashboardTemplateProps { data: DashboardViewData; } 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, rank, consistency } = currentDriver; return (
{/* Hero Section */}
{/* Background Pattern */}
{/* Welcome Message */}
{currentDriver.name}

{getGreeting()},

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

{rating}
#{rank}
{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.formattedDate} {nextRace.formattedTime}

Starts in

{nextRace.timeUntil}

)} {/* 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

)}
); }