website refactor

This commit is contained in:
2026-01-14 23:46:04 +01:00
parent c1a86348d7
commit 4a2d7d15a5
294 changed files with 5637 additions and 3418 deletions

View File

@@ -0,0 +1,46 @@
import { usePageMutation } from '@/lib/page/usePageData';
export function useLeagueStewardingMutations(onRefetch: () => void) {
const acceptProtestMutation = usePageMutation(
async (variables: { protestId: string; penaltyType: string; penaltyValue: number; stewardNotes: string; raceId: string; accusedDriverId: string; reason: string }) => {
// TODO: Implement protest review and penalty application
// await leagueStewardingService.reviewProtest({
// protestId: variables.protestId,
// stewardId: currentDriverId,
// decision: 'uphold',
// decisionNotes: variables.stewardNotes,
// });
// await leagueStewardingService.applyPenalty({
// raceId: variables.raceId,
// driverId: variables.accusedDriverId,
// stewardId: currentDriverId,
// type: variables.penaltyType,
// value: variables.penaltyValue,
// reason: variables.reason,
// protestId: variables.protestId,
// notes: variables.stewardNotes,
// });
},
{
onSuccess: () => onRefetch(),
}
);
const rejectProtestMutation = usePageMutation(
async (variables: { protestId: string; stewardNotes: string }) => {
// TODO: Implement protest rejection
// await leagueStewardingService.reviewProtest({
// protestId: variables.protestId,
// stewardId: currentDriverId,
// decision: 'dismiss',
// decisionNotes: variables.stewardNotes,
// });
},
{
onSuccess: () => onRefetch(),
}
);
return { acceptProtestMutation, rejectProtestMutation };
}