'use client'; import { LeaderboardFiltersBar } from '@/components/leaderboards/LeaderboardFiltersBar'; import type { SkillLevel, SortBy, TeamLeaderboardViewData } from '@/lib/view-data/TeamLeaderboardViewData'; import { Button } from '@/ui/Button'; import { Container } from '@/ui/Container'; import { Heading } from '@/ui/Heading'; import { Icon } from '@/ui/Icon'; import { Box } from '@/ui/primitives/Box'; import { Stack } from '@/ui/primitives/Stack'; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/ui/Table'; import { Text } from '@/ui/Text'; import { Award, ChevronLeft } from 'lucide-react'; interface TeamLeaderboardTemplateProps { viewData: TeamLeaderboardViewData; onSearchChange: (query: string) => void; filterLevelChange: (level: SkillLevel | 'all') => void; onSortChange: (sort: SortBy) => void; onTeamClick: (id: string) => void; onBackToTeams: () => void; } export function TeamLeaderboardTemplate({ viewData, onSearchChange, onTeamClick, onBackToTeams, }: TeamLeaderboardTemplateProps) { const { searchQuery, filteredAndSortedTeams } = viewData; return ( {/* Header */} Global Standings Team Performance Index Rank Team Personnel Races Rating {filteredAndSortedTeams.length > 0 ? ( filteredAndSortedTeams.map((team, index) => ( onTeamClick(team.id)} cursor="pointer" hoverBg="surface-charcoal/50" > #{index + 1} {team.name.substring(0, 2).toUpperCase()} {team.name} {team.memberCount} {team.totalRaces} 1450 )) ) : ( No teams found matching criteria )}
); }