'use client'; import { RulebookTabs, type RulebookSection } from '@/components/leagues/RulebookTabs'; import { PointsTable } from '@/components/races/PointsTable'; import type { RulebookViewData } from '@/lib/view-data/RulebookViewData'; import { Box } from '@/ui/Box'; import { Grid } from '@/ui/Grid'; import { Heading } from '@/ui/Heading'; import { Icon } from '@/ui/Icon'; import { Stack } from '@/ui/Stack'; import { Surface } from '@/ui/Surface'; import { Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow } from '@/ui/Table'; import { Text } from '@/ui/Text'; import { AlertTriangle, Book, Clock, Info, Scale, Shield, type LucideIcon } from 'lucide-react'; import { useState } from 'react'; interface RulebookTemplateProps { viewData: RulebookViewData; } export function RulebookTemplate({ viewData, }: RulebookTemplateProps) { const [activeSection, setActiveSection] = useState('scoring'); if (!viewData) { return ( Unable to load rulebook ); } return ( {/* Navigation Tabs */} {/* Content Sections */} {activeSection === 'scoring' && ( {/* Quick Stats */} {/* Weekend Structure */} WEEKEND STRUCTURE {/* Points Table */} {/* Bonus Points */} {viewData.hasBonusPoints && ( BONUS POINTS {viewData.bonusPoints.map((bonus, idx) => ( + {bonus} ))} )} )} {activeSection === 'conduct' && ( DRIVER CONDUCT )} {activeSection === 'protests' && ( PROTEST PROCESS )} {activeSection === 'penalties' && ( PENALTY GUIDELINES Infraction Typical Penalty
)}
); } function StatItem({ icon, label, value, color }: { icon: LucideIcon, label: string, value: string | number, color: string }) { return ( {label.toUpperCase()} {value} ); } function TimingItem({ label, value }: { label: string, value: string }) { return ( {label} {value} ); } function ConductItem({ number, title, text }: { number: number, title: string, text: string }) { return ( {number}. {title} {text} ); } function PenaltyRow({ infraction, penalty, isSevere }: { infraction: string, penalty: string, isSevere?: boolean }) { return ( {infraction} {penalty} ); }