Extract shared form field components and enum utilities #17
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context: Form components duplicate several patterns:
toDatetimeLocal()function copied identically in VIPForm and EventFormFiles affected:
frontend/src/components/VIPForm.tsx(lines 47-57, 134-390, 197-199)frontend/src/components/DriverForm.tsx(lines 74-137, 114-118)frontend/src/components/EventForm.tsx(lines 44-54, 319-494, 455-477)frontend/src/pages/VipList.tsx(lines 190-202)frontend/src/pages/DriverList.tsx(lines 195-202)Suggested fix:
toDatetimeLocal()tofrontend/src/lib/utils.tsfrontend/src/lib/enum-labels.tswith all enum display mappings<FormField>wrapper component for label+input+error patternEffort: Small
Moved to shared utils. Created with DEPARTMENT_LABELS, ARRIVAL_MODE_LABELS, EVENT_TYPE_LABELS, EVENT_STATUS_LABELS. Updated all form and list files.