import { mediaConfig } from '@/lib/config/mediaConfig'; import { CountryFlagFormatter } from '@/lib/formatters/CountryFlagFormatter'; import { Box } from '@/ui/Box'; import { Button } from '@/ui/Button'; import { Heading } from '@/ui/Heading'; import { Icon } from '@/ui/Icon'; import { Image } from '@/ui/Image'; import { Link } from '@/ui/Link'; import { Stack } from '@/ui/Stack'; import { Surface } from '@/ui/Surface'; import { Text } from '@/ui/Text'; import { Calendar, Clock, ExternalLink, Globe, Star, Trophy, UserPlus } from 'lucide-react'; interface ProfileHeroProps { driver: { name: string; avatarUrl?: string; country: string; iracingId: number; joinedAtLabel: string; }; stats: { ratingLabel: string; } | null; globalRankLabel: string; timezone: string; socialHandles: { platform: string; handle: string; url: string; }[]; onAddFriend: () => void; friendRequestSent: boolean; } function getSocialIcon(platform: string) { const { Twitter, Youtube, Twitch, MessageCircle } = require('lucide-react'); switch (platform) { case 'twitter': return Twitter; case 'youtube': return Youtube; case 'twitch': return Twitch; case 'discord': return MessageCircle; default: return Globe; } } export function ProfileHero({ driver, stats, globalRankLabel, timezone, socialHandles, onAddFriend, friendRequestSent, }: ProfileHeroProps) { return ( {/* Avatar */} {driver.name} {/* Driver Info */} {driver.name} {CountryFlagFormatter.fromCountryCode(driver.country).toString()} {/* Rating and Rank */} {stats && ( <> {stats.ratingLabel} Rating {globalRankLabel} Global )} {/* Meta info */} iRacing: {driver.iracingId} Joined {driver.joinedAtLabel} {timezone} {/* Action Buttons */} {/* Social Handles */} {socialHandles.length > 0 && ( Connect: {socialHandles.map((social) => { const SocialIcon = getSocialIcon(social.platform); return ( {social.handle} ); })} )} ); }