import { LeaderboardFiltersBar } from '@/components/leaderboards/LeaderboardFiltersBar'; import type { SkillLevel, SortBy } from '@/lib/view-data/TeamLeaderboardViewData'; import type { TeamSummaryViewModel } from '@/lib/view-models/TeamSummaryViewModel'; import { Button } from '@/ui/Button'; import { Heading } from '@/ui/Heading'; import { Icon } from '@/ui/Icon'; import { Panel } from '@/ui/Panel'; import { Section } from '@/ui/Section'; import { Select } from '@/ui/Select'; import { Table, TableBody, TableCell, TableHead, TableRow } from '@/ui/Table'; import { Group } from '@/ui/Group'; import { Text } from '@/ui/Text'; import { Award, ChevronLeft, Users } from 'lucide-react'; interface TeamLeaderboardTemplateProps { viewData: { teams: TeamSummaryViewModel[]; searchQuery: string; filterLevel: SkillLevel | 'all'; sortBy: SortBy; filteredAndSortedTeams: TeamSummaryViewModel[]; }; onSearchChange: (query: string) => void; filterLevelChange: (level: SkillLevel | 'all') => void; onSortChange: (sort: SortBy) => void; onTeamClick: (id: string) => void; onBackToTeams: () => void; } export function TeamLeaderboardTemplate({ viewData, onSearchChange, filterLevelChange, onSortChange, onTeamClick, onBackToTeams, }: TeamLeaderboardTemplateProps) { const { searchQuery, filterLevel, sortBy, filteredAndSortedTeams } = viewData; const levelOptions = [ { value: 'all', label: 'All Levels' }, { value: 'pro', label: 'Professional' }, { value: 'advanced', label: 'Advanced' }, { value: 'intermediate', label: 'Intermediate' }, { value: 'beginner', label: 'Beginner' }, ]; const sortOptions = [ { value: 'rating', label: 'Rating' }, { value: 'wins', label: 'Wins' }, { value: 'winRate', label: 'Win Rate' }, { value: 'races', label: 'Races' }, ]; return (
{/* Header */} Team Standings Global Performance Index onSortChange(e.target.value as SortBy)} /> Rank Team Personnel Races Wins Rating {filteredAndSortedTeams.length > 0 ? ( filteredAndSortedTeams.map((team, index) => ( onTeamClick(team.id)} clickable > #{index + 1} {team.name} {team.performanceLevel} {team.memberCount} {team.totalRaces} {team.totalWins} {team.rating?.toFixed(0) || '1000'} )) ) : (
No teams found matching criteria
)}
); }