mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 16:03:21 +00:00
feat: Ajout de la fratrie / Gestion des index de fratrie / Gestion des
required
This commit is contained in:
@ -2,6 +2,7 @@ import InputText from '@/components/InputText';
|
||||
import React, { useEffect } from 'react';
|
||||
import { Trash2, Plus, Users } from 'lucide-react';
|
||||
import SectionHeader from '@/components/SectionHeader';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
export default function SiblingInputFields({
|
||||
siblings,
|
||||
@ -67,6 +68,7 @@ export default function SiblingInputFields({
|
||||
setSiblings([
|
||||
...siblings,
|
||||
{
|
||||
id: `temp-${uuidv4()}`,
|
||||
last_name: '',
|
||||
first_name: '',
|
||||
birth_date: '',
|
||||
@ -105,10 +107,8 @@ export default function SiblingInputFields({
|
||||
onChange={(event) => {
|
||||
onSiblingsChange(item.id, 'last_name', event.target.value);
|
||||
}}
|
||||
errorMsg={
|
||||
getError(index, 'last_name') ||
|
||||
getLocalError(index, 'last_name')
|
||||
}
|
||||
errorMsg={getError('last_name')}
|
||||
errorLocalMsg={getLocalError(index, 'last_name')}
|
||||
required
|
||||
/>
|
||||
<InputText
|
||||
@ -119,10 +119,8 @@ export default function SiblingInputFields({
|
||||
onChange={(event) => {
|
||||
onSiblingsChange(item.id, 'first_name', event.target.value);
|
||||
}}
|
||||
errorMsg={
|
||||
getError(index, 'first_name') ||
|
||||
getLocalError(index, 'first_name')
|
||||
}
|
||||
errorMsg={getError('first_name')}
|
||||
errorLocalMsg={getLocalError(index, 'first_name')}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
@ -136,10 +134,8 @@ export default function SiblingInputFields({
|
||||
onChange={(event) => {
|
||||
onSiblingsChange(item.id, 'birth_date', event.target.value);
|
||||
}}
|
||||
errorMsg={
|
||||
getError(index, 'birth_date') ||
|
||||
getLocalError(index, 'birth_date')
|
||||
}
|
||||
errorMsg={getError('birth_date')}
|
||||
errorLocalMsg={getLocalError(index, 'birth_date')}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user