diff --git a/Front-End/src/components/FileUpload.js b/Front-End/src/components/FileUpload.js index a461a9b..f809323 100644 --- a/Front-End/src/components/FileUpload.js +++ b/Front-End/src/components/FileUpload.js @@ -69,7 +69,9 @@ export default function FileUpload({

- {existingFile.split('/').pop()} + {typeof existingFile === 'string' + ? existingFile.split('/').pop() + : existingFile?.name || 'Fichier inconnu'}

diff --git a/Front-End/src/components/Inscription/ResponsableInputFields.js b/Front-End/src/components/Inscription/ResponsableInputFields.js index a9f5b18..e2397d4 100644 --- a/Front-End/src/components/Inscription/ResponsableInputFields.js +++ b/Front-End/src/components/Inscription/ResponsableInputFields.js @@ -14,6 +14,7 @@ export default function ResponsableInputFields({ }) { const t = useTranslations('ResponsableInputFields'); const { selectedEstablishmentId } = useEstablishment(); + const MAX_GUARDIANS = 2; useEffect(() => { const isValid = @@ -241,8 +242,20 @@ export default function ResponsableInputFields({
addGuardian(e)} + 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); + } + }} />