'use client'; import React from 'react'; import { Users, ChevronRight, UserPlus, Zap, Clock, Globe, Languages, Crown, Star, TrendingUp, Shield } from 'lucide-react'; import { Card } from '@/ui/Card'; import { Box } from '@/ui/Box'; import { Stack } from '@/ui/Stack'; import { Text } from '@/ui/Text'; import { Heading } from '@/ui/Heading'; import { Badge } from '@/ui/Badge'; import { Image } from '@/ui/Image'; import PlaceholderImage from '@/ui/PlaceholderImage'; interface TeamCardProps { id: string; name: string; description?: string; logo?: string; memberCount: number; rating?: number | null; totalWins?: number; totalRaces?: number; performanceLevel?: 'beginner' | 'intermediate' | 'advanced' | 'pro'; isRecruiting?: boolean; specialization?: 'endurance' | 'sprint' | 'mixed' | undefined; region?: string; languages?: string[] | undefined; leagues?: string[]; category?: string; onClick?: () => void; } function getPerformanceBadge(level?: string) { switch (level) { case 'pro': return { icon: Crown, label: 'Pro', variant: 'warning' as const }; case 'advanced': return { icon: Star, label: 'Advanced', variant: 'primary' as const }; case 'intermediate': return { icon: TrendingUp, label: 'Intermediate', variant: 'info' as const }; case 'beginner': return { icon: Shield, label: 'Beginner', variant: 'success' as const }; default: return null; } } function getSpecializationBadge(specialization?: string) { switch (specialization) { case 'endurance': return { icon: Clock, label: 'Endurance', color: '#f97316' }; case 'sprint': return { icon: Zap, label: 'Sprint', color: '#00f2ff' }; default: return null; } } export function TeamCard({ name, description, logo, memberCount, rating, totalWins, totalRaces, performanceLevel, isRecruiting, specialization, region, languages, category, onClick, }: TeamCardProps) { const performanceBadge = getPerformanceBadge(performanceLevel); const specializationBadge = getSpecializationBadge(specialization); return ( {/* Header with Logo */} {/* Logo */} {logo ? ( {name} ) : ( )} {/* Title & Badges */} {name} {isRecruiting && ( Recruiting )} {/* Performance Level & Category */} {performanceBadge && ( {performanceBadge.label} )} {specializationBadge && ( {specializationBadge.label} )} {category && ( {category} )} {/* Content */} {/* Description */} {description || 'No description available'} {/* Region & Languages */} {(region || (languages && languages.length > 0)) && ( {region && ( {region} )} {languages && languages.length > 0 && ( {languages.slice(0, 2).join(', ')} {languages.length > 2 && ` +${languages.length - 2}`} )} )} {/* Stats Grid */} {/* Spacer */} {/* Footer */} {memberCount} {memberCount === 1 ? 'member' : 'members'} View ); } function StatItem({ label, value, color }: { label: string, value: string | number, color: string }) { return ( {label} {value} ); }