website refactor

This commit is contained in:
2026-01-18 13:26:35 +01:00
parent 350c78504d
commit 0b301feb61
225 changed files with 1678 additions and 26666 deletions

View File

@@ -0,0 +1,51 @@
import { PenaltyRow } from '@/components/races/PenaltyRow';
interface PenaltyEntry {
driverId: string;
driverName: string;
type: 'time_penalty' | 'grid_penalty' | 'points_deduction' | 'disqualification' | 'warning' | 'license_points';
value: number;
reason: string;
notes?: string;
}
interface RacePenaltyRowProps {
penalty: PenaltyEntry;
}
export function RacePenaltyRow({ penalty }: RacePenaltyRowProps) {
const getValue = () => {
switch (penalty.type) {
case 'time_penalty': return `+${penalty.value}`;
case 'grid_penalty': return `+${penalty.value}`;
case 'points_deduction': return `-${penalty.value}`;
case 'disqualification': return 'DSQ';
case 'warning': return 'Warning';
case 'license_points': return `${penalty.value}`;
default: return penalty.value;
}
};
const getValueLabel = () => {
switch (penalty.type) {
case 'time_penalty': return 's';
case 'grid_penalty': return 'grid';
case 'points_deduction': return 'pts';
case 'license_points': return 'LP';
default: return '';
}
};
return (
<PenaltyRow
driverName={penalty.driverName}
type={penalty.type}
reason={penalty.reason}
notes={penalty.notes}
value={getValue()}
valueLabel={getValueLabel()}
/>
);
}