fix: Ajout du mode Visu

This commit is contained in:
N3WT DE COMPET
2025-05-04 14:32:06 +02:00
parent 4ecf25a6ab
commit e1c607308c
29 changed files with 531 additions and 414 deletions

View File

@ -11,6 +11,7 @@ export default function ResponsableInputFields({
setGuardians,
errors,
setIsPageValid,
enable = true,
}) {
const t = useTranslations('ResponsableInputFields');
const { selectedEstablishmentId } = useEstablishment();
@ -145,6 +146,7 @@ export default function ResponsableInputFields({
errorMsg={getError('last_name')}
errorLocalMsg={getLocalError(index, 'last_name')}
required
enable={enable}
/>
<InputText
name="prenomResponsable"
@ -157,6 +159,7 @@ export default function ResponsableInputFields({
errorMsg={getError('first_name')}
errorLocalMsg={getLocalError(index, 'first_name')}
required
enable={enable}
/>
</div>
@ -176,6 +179,7 @@ export default function ResponsableInputFields({
errorMsg={getError('associated_profile_email')}
errorLocalMsg={getLocalError(index, 'associated_profile_email')}
required
enable={enable}
/>
<InputPhone
name="telephoneResponsable"
@ -187,6 +191,7 @@ export default function ResponsableInputFields({
errorMsg={getError('phone')}
errorLocalMsg={getLocalError(index, 'phone')}
required
enable={enable}
/>
</div>
@ -202,6 +207,7 @@ export default function ResponsableInputFields({
errorMsg={getError('birth_date')}
errorLocalMsg={getLocalError(index, 'birth_date')}
required
enable={enable}
/>
<InputText
name="professionResponsable"
@ -214,6 +220,7 @@ export default function ResponsableInputFields({
errorMsg={getError('profession')}
errorLocalMsg={getLocalError(index, 'profession')}
required
enable={enable}
/>
</div>
@ -229,29 +236,32 @@ export default function ResponsableInputFields({
errorMsg={getError('address')}
errorLocalMsg={getLocalError(index, 'address')}
required
enable={enable}
/>
</div>
</div>
))}
<div className="flex justify-center">
<Plus
className={`w-8 h-8 ${
guardians.length >= MAX_GUARDIANS
? 'text-gray-400 cursor-not-allowed'
: 'text-green-500 cursor-pointer hover:text-green-700'
} transition-colors border-2 ${
guardians.length >= MAX_GUARDIANS
? 'border-gray-400'
: 'border-green-500 hover:border-green-700'
} rounded-full p-1`}
onClick={(e) => {
if (guardians.length < MAX_GUARDIANS) {
addGuardian(e);
}
}}
/>
</div>
{enable && (
<div className="flex justify-center">
<Plus
className={`w-8 h-8 ${
guardians.length >= MAX_GUARDIANS
? 'text-gray-400 cursor-not-allowed'
: 'text-green-500 cursor-pointer hover:text-green-700'
} transition-colors border-2 ${
guardians.length >= MAX_GUARDIANS
? 'border-gray-400'
: 'border-green-500 hover:border-green-700'
} rounded-full p-1`}
onClick={(e) => {
if (guardians.length < MAX_GUARDIANS) {
addGuardian(e);
}
}}
/>
</div>
)}
</div>
);
}