chore: remove Insurance default bias from Add Document modal (refs #175)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -31,8 +31,8 @@ export const DocumentForm: React.FC<DocumentFormProps> = ({
|
||||
onSuccess,
|
||||
onCancel
|
||||
}) => {
|
||||
const [documentType, setDocumentType] = React.useState<DocumentType>(
|
||||
initialValues?.documentType || 'insurance'
|
||||
const [documentType, setDocumentType] = React.useState<DocumentType | ''>(
|
||||
initialValues?.documentType || ''
|
||||
);
|
||||
const [vehicleID, setVehicleID] = React.useState<string>(initialValues?.vehicleId || '');
|
||||
const [title, setTitle] = React.useState<string>(initialValues?.title || '');
|
||||
@@ -152,6 +152,10 @@ export const DocumentForm: React.FC<DocumentFormProps> = ({
|
||||
setError('Please select a vehicle.');
|
||||
return;
|
||||
}
|
||||
if (!documentType) {
|
||||
setError('Please select a document type.');
|
||||
return;
|
||||
}
|
||||
if (!title.trim()) {
|
||||
setError('Please enter a title.');
|
||||
return;
|
||||
@@ -337,7 +341,9 @@ export const DocumentForm: React.FC<DocumentFormProps> = ({
|
||||
value={documentType}
|
||||
onChange={(e) => setDocumentType(e.target.value as DocumentType)}
|
||||
disabled={mode === 'edit'}
|
||||
required
|
||||
>
|
||||
<option value="" disabled>Select a document type...</option>
|
||||
<option value="insurance">Insurance</option>
|
||||
<option value="registration">Registration</option>
|
||||
<option value="manual">Manual</option>
|
||||
|
||||
Reference in New Issue
Block a user