'use client'; import { EmptyState } from '@/ui/EmptyState'; import { LoadingWrapper } from '@/ui/LoadingWrapper'; import { Button } from '@/ui/Button'; import { Card } from '@/ui/Card'; import { Pagination } from '@/ui/Pagination'; import { Text } from '@/ui/Text'; import { Box } from '@/ui/Box'; import { Group } from '@/ui/Group'; import { Stack } from '@/ui/Stack'; import { ControlBar } from '@/ui/ControlBar'; import { Trophy } from 'lucide-react'; import React, { 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. } 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 ; } if (filteredResults.length === 0) { return ( ); } return ( No results found for the selected filter. ); }