website cleanup

This commit is contained in:
2025-12-24 13:04:18 +01:00
parent 5e491d9724
commit a7aee42409
69 changed files with 1624 additions and 938 deletions

View File

@@ -2,10 +2,7 @@
import { useState, useEffect } from 'react';
import Card from '@/components/ui/Card';
import {
loadTeamStandings,
type TeamLeagueStandingViewModel,
} from '@/lib/presenters/TeamStandingsPresenter';
import { useServices } from '@/lib/services/ServiceProvider';
interface TeamStandingsProps {
teamId: string;
@@ -13,14 +10,25 @@ interface TeamStandingsProps {
}
export default function TeamStandings({ teamId, leagues }: TeamStandingsProps) {
const [standings, setStandings] = useState<TeamLeagueStandingViewModel[]>([]);
const { leagueService } = useServices();
const [standings, setStandings] = useState<any[]>([]);
const [loading, setLoading] = useState(true);
useEffect(() => {
const load = async () => {
try {
const viewModel = await loadTeamStandings(teamId, leagues);
setStandings(viewModel.standings);
// For demo purposes, create mock standings
const mockStandings = leagues.map(leagueId => ({
leagueId,
leagueName: `League ${leagueId}`,
position: Math.floor(Math.random() * 10) + 1,
points: Math.floor(Math.random() * 100),
wins: Math.floor(Math.random() * 5),
racesCompleted: Math.floor(Math.random() * 10),
}));
setStandings(mockStandings);
} catch (error) {
console.error('Failed to load standings:', error);
} finally {
setLoading(false);
}