website refactor

This commit is contained in:
2026-01-15 18:52:03 +01:00
parent f035cfe7ce
commit 5ef149b782
39 changed files with 564 additions and 518 deletions

View File

@@ -44,7 +44,6 @@ interface RaceStewardingTemplateProps {
export function RaceStewardingTemplate({
viewData,
isLoading,
error,
onBack,
onReviewProtest,
isAdmin,
@@ -77,9 +76,9 @@ export function RaceStewardingTemplate({
<Surface variant="muted" rounded="full" padding={4}>
<Icon icon={AlertTriangle} size={8} color="#f59e0b" />
</Surface>
<Box style={{ textAlign: 'center' }}>
<Box textAlign="center">
<Text weight="medium" color="text-white" block mb={1}>Race not found</Text>
<Text size="sm" color="text-gray-500">The race you're looking for doesn't exist.</Text>
<Text size="sm" color="text-gray-500">The race you&apos;re looking for doesn&apos;t exist.</Text>
</Box>
<Button variant="secondary" onClick={onBack}>
Back to Races
@@ -112,9 +111,9 @@ export function RaceStewardingTemplate({
</Stack>
{/* Header */}
<Surface variant="muted" rounded="xl" border padding={6} style={{ background: 'linear-gradient(to right, rgba(38, 38, 38, 0.5), rgba(38, 38, 38, 0.3))', borderColor: '#262626' }}>
<Surface variant="muted" rounded="xl" border padding={6} bg="bg-gradient-to-r from-neutral-800/50 to-neutral-800/30" borderColor="border-neutral-800">
<Stack direction="row" align="center" gap={4} mb={6}>
<Surface variant="muted" rounded="xl" padding={3} style={{ backgroundColor: 'rgba(59, 130, 246, 0.2)' }}>
<Surface variant="muted" rounded="xl" padding={3} bg="bg-blue-500/20">
<Icon icon={Scale} size={6} color="#3b82f6" />
</Surface>
<Box>
@@ -149,7 +148,7 @@ export function RaceStewardingTemplate({
<Surface variant="muted" rounded="full" padding={4}>
<Icon icon={Flag} size={8} color="#10b981" />
</Surface>
<Box style={{ textAlign: 'center' }}>
<Box textAlign="center">
<Text weight="semibold" size="lg" color="text-white" block mb={1}>All Clear!</Text>
<Text size="sm" color="text-gray-400">No pending protests to review</Text>
</Box>
@@ -159,7 +158,7 @@ export function RaceStewardingTemplate({
viewData.pendingProtests.map((protest) => (
<ProtestCard
key={protest.id}
protest={protest as any}
protest={protest}
protester={viewData.driverMap[protest.protestingDriverId]}
accused={viewData.driverMap[protest.accusedDriverId]}
isAdmin={isAdmin}
@@ -179,7 +178,7 @@ export function RaceStewardingTemplate({
<Surface variant="muted" rounded="full" padding={4}>
<Icon icon={CheckCircle} size={8} color="#525252" />
</Surface>
<Box style={{ textAlign: 'center' }}>
<Box textAlign="center">
<Text weight="semibold" size="lg" color="text-white" block mb={1}>No Resolved Protests</Text>
<Text size="sm" color="text-gray-400">Resolved protests will appear here</Text>
</Box>
@@ -189,7 +188,7 @@ export function RaceStewardingTemplate({
viewData.resolvedProtests.map((protest) => (
<ProtestCard
key={protest.id}
protest={protest as any}
protest={protest}
protester={viewData.driverMap[protest.protestingDriverId]}
accused={viewData.driverMap[protest.accusedDriverId]}
isAdmin={isAdmin}
@@ -209,7 +208,7 @@ export function RaceStewardingTemplate({
<Surface variant="muted" rounded="full" padding={4}>
<Icon icon={Gavel} size={8} color="#525252" />
</Surface>
<Box style={{ textAlign: 'center' }}>
<Box textAlign="center">
<Text weight="semibold" size="lg" color="text-white" block mb={1}>No Penalties</Text>
<Text size="sm" color="text-gray-400">Penalties issued for this race will appear here</Text>
</Box>
@@ -217,7 +216,14 @@ export function RaceStewardingTemplate({
</Card>
) : (
viewData.penalties.map((penalty) => (
<RacePenaltyRow key={penalty.id} penalty={penalty as any} />
<RacePenaltyRow
key={penalty.id}
penalty={{
...penalty,
driverName: viewData.driverMap[penalty.driverId]?.name || 'Unknown',
type: penalty.type as 'time_penalty' | 'grid_penalty' | 'points_deduction' | 'disqualification' | 'warning' | 'license_points'
}}
/>
))
)}
</Stack>