'use client'; import React from 'react'; import { mediaConfig } from '@/lib/config/mediaConfig'; import { CountryFlagDisplay } from '@/lib/display-objects/CountryFlagDisplay'; import { Box } from '@/ui/Box'; import { Button } from '@/ui/Button'; import { Heading } from '@/ui/Heading'; import { Image } from '@/ui/Image'; import { Stack } from '@/ui/Stack'; import { Surface } from '@/ui/Surface'; import { Text } from '@/ui/Text'; import { Calendar, Globe, Star, Trophy, UserPlus } from 'lucide-react'; interface ProfileHeaderProps { driver: { name: string; avatarUrl?: string; country: string; iracingId: number; joinedAt: string | Date; }; stats: { rating: number; } | null; globalRank: number; onAddFriend?: () => void; friendRequestSent?: boolean; isOwnProfile?: boolean; } export function ProfileHeader({ driver, stats, globalRank, onAddFriend, friendRequestSent, isOwnProfile, }: ProfileHeaderProps) { return (
{/* Avatar with telemetry-style border */} {driver.name} {/* Driver Info */} {driver.name} {CountryFlagDisplay.fromCountryCode(driver.country).toString()} ID: {driver.iracingId} Joined {new Date(driver.joinedAt).toLocaleDateString('en-US', { month: 'short', year: 'numeric' })} {/* Stats Grid */} {stats && ( <> RATING {stats.rating} GLOBAL RANK #{globalRank} )} {/* Actions */} {!isOwnProfile && onAddFriend && ( )}
); }