'use client'; import { EmptyState } from '@/components/shared/state/EmptyState'; import { LoadingWrapper } from '@/components/shared/state/LoadingWrapper'; import { Button } from '@/ui/Button'; import { Card } from '@/ui/Card'; import { Pagination } from '@/ui/Pagination'; import { Stack } from '@/ui/primitives/Stack'; import { Text } from '@/ui/Text'; import { Trophy } from 'lucide-react'; import { useEffect, useState } from 'react'; interface RaceHistoryProps { driverId: string; } export function ProfileRaceHistory({ driverId }: RaceHistoryProps) { const [filter, setFilter] = useState<'all' | 'wins' | 'podiums'>('all'); const [page, setPage] = useState(1); const [loading, setLoading] = useState(true); const resultsPerPage = 10; useEffect(() => { async function loadRaceHistory() { try { // Driver race history is not exposed via API yet. // Keep as placeholder until an endpoint exists. } catch (err) { console.error('Failed to load race history:', err); } finally { setLoading(false); } } loadRaceHistory(); }, [driverId]); const filteredResults: Array = []; const totalPages = Math.ceil(filteredResults.length / resultsPerPage); if (loading) { return ( {[1, 2, 3].map(i => ( ))} ); } if (filteredResults.length === 0) { return ( ); } return ( {/* No results until API provides driver results */} No results found for the selected filter. ); }