'use client'; import { SkillLevelHeader } from '@/components/drivers/SkillLevelHeader'; import { TeamCard } from '@/components/teams/TeamCardWrapper'; import { TeamGrid } from '@/components/teams/TeamGrid'; import { Box } from '@/ui/Box'; import { LucideIcon } from 'lucide-react'; import { useState } from 'react'; type SkillLevel = 'pro' | 'advanced' | 'intermediate' | 'beginner'; type TeamSpecialization = 'endurance' | 'sprint' | 'mixed'; interface SkillLevelConfig { id: SkillLevel; label: string; icon: LucideIcon; color: string; bgColor: string; borderColor: string; description: string; } interface SkillLevelSectionProps { level: SkillLevelConfig; teams: Array<{ id: string; name: string; description?: string; logoUrl?: string; memberCount: number; ratingLabel: string; winsLabel: string; racesLabel: string; performanceLevel: string; isRecruiting: boolean; specialization?: string; region?: string; languages: string[]; category?: string; }>; onTeamClick: (id: string) => void; defaultExpanded?: boolean; } export function SkillLevelSection({ level, teams, onTeamClick, defaultExpanded = false }: SkillLevelSectionProps) { const [isExpanded, setIsExpanded] = useState(defaultExpanded); const recruitingTeams = teams.filter((t) => t.isRecruiting); const displayedTeams = isExpanded ? teams : teams.slice(0, 3); if (teams.length === 0) return null; const specialization = (teamSpecialization: string | undefined): TeamSpecialization | undefined => { if (teamSpecialization === 'endurance' || teamSpecialization === 'sprint' || teamSpecialization === 'mixed') { return teamSpecialization; } return undefined; }; return ( setIsExpanded(!isExpanded)} showToggle={teams.length > 3} /> {displayedTeams.map((team) => ( onTeamClick(team.id)} /> ))} ); }