feat(#22): Driver profile page

Implemented by claude via .agents/dev dispatch.
This commit is contained in:
2026-07-11 18:12:00 -04:00
parent 1782fd313c
commit 01ec1f24e7
14 changed files with 1421 additions and 23 deletions

View File

@@ -2,6 +2,7 @@ import type {
ArticleContent,
CarDataSample,
ChampionshipHub,
DriverSummary,
LapsComparisonResponse,
LiveStateResponse,
LiveSessionMeta,
@@ -76,6 +77,19 @@ export async function fetchChampionshipHub(year?: number): Promise<ChampionshipH
return res.json()
}
export async function fetchDriverSummary(
driverNumber: number,
year?: number,
): Promise<DriverSummary> {
const params = new URLSearchParams({ driver_number: String(driverNumber) })
if (year) params.set('year', String(year))
const res = await fetch(`/api/v1/driver/summary?${params.toString()}`)
if (!res.ok) {
throw new Error(`API ${res.status}: ${res.statusText}`)
}
return res.json()
}
export async function fetchLiveState(): Promise<LiveStateResponse> {
const res = await fetch('/api/v1/live/state')
if (!res.ok) {