feat: Aussi pour la table des parents tant qu'à faire

This commit is contained in:
N3WT DE COMPET
2025-03-14 21:27:29 +01:00
parent 91976157e4
commit a3182c0ba7

View File

@ -85,26 +85,31 @@ const ProfileDirectory = ({ profileRoles, handleActivateProfile, handleDeletePro
) )
}, },
{ name: 'Utilisateur', transform: (row) => ( { name: 'Utilisateur', transform: (row) => (
<div className="flex flex-col justify-center space-y-2"> <div className="flex items-center justify-center space-x-2">
{row.associated_person?.guardian_name} <span>{row.associated_person?.guardian_name}</span>
</div> {row.associated_person && (
) <Tooltip content={
}, <div>
{ name: 'Elève(s) associé(s)', transform: (row) => ( <div className="mb-2">
<div className="flex flex-col justify-center space-y-2"> <strong>Elève(s) associé(s):</strong>
{row.associated_person?.students?.map(student => ( <div className="flex flex-col justify-center space-y-2">
<span key={student.student_name} className="px-2 py-1 rounded-full text-gray-800"> {row.associated_person?.students?.map(student => (
{student.student_name} <div key={student.student_name} className="flex justify-between items-center">
</span> <span className="px-2 py-1 rounded-full text-gray-800">
))} {student.student_name}
</div> </span>
) <StatusLabel status={student.registration_status} showDropdown={false} />
}, </div>
{ name: 'Etat du dossier d\'inscription', transform: (row) => ( ))}
<div className="flex flex-col justify-center items-center space-y-2"> </div>
{row.associated_person?.students?.map(student => ( </div>
<StatusLabel key={student.student_name} status={student.registration_status} showDropdown={false} /> </div>
))} }>
<button className="text-blue-500 hover:text-blue-700">
<Info className="w-5 h-5" />
</button>
</Tooltip>
)}
</div> </div>
) )
}, },
@ -142,32 +147,34 @@ const ProfileDirectory = ({ profileRoles, handleActivateProfile, handleDeletePro
{ name: 'Utilisateur', transform: (row) => ( { name: 'Utilisateur', transform: (row) => (
<div className="flex items-center justify-center space-x-2"> <div className="flex items-center justify-center space-x-2">
<span>{row.associated_person?.teacher_name}</span> <span>{row.associated_person?.teacher_name}</span>
<Tooltip content={ {row.associated_person && (
<div> <Tooltip content={
<div className="mb-2">
<strong>Classes associées:</strong>
<div className="flex flex-wrap justify-center space-x-2">
{row.associated_person?.classes?.map(classe => (
<span key={classe.id} className="px-2 py-1 rounded-full bg-gray-200 text-gray-800">
{classe.name}
</span>
))}
</div>
</div>
<div> <div>
<strong>Spécialités:</strong> <div className="mb-2">
<div className="flex flex-wrap justify-center space-x-2"> <strong>Classes associées:</strong>
{row.associated_person?.specialities?.map(speciality => ( <div className="flex flex-wrap justify-center space-x-2">
<SpecialityItem key={speciality.name} speciality={speciality} isDraggable={false} /> {row.associated_person?.classes?.map(classe => (
))} <span key={classe.id} className="px-2 py-1 rounded-full bg-gray-200 text-gray-800">
{classe.name}
</span>
))}
</div>
</div>
<div>
<strong>Spécialités:</strong>
<div className="flex flex-wrap justify-center space-x-2">
{row.associated_person?.specialities?.map(speciality => (
<SpecialityItem key={speciality.name} speciality={speciality} isDraggable={false} />
))}
</div>
</div> </div>
</div> </div>
</div> }>
}> <button className="text-blue-500 hover:text-blue-700">
<button className="text-blue-500 hover:text-blue-700"> <Info className="w-5 h-5" />
<Info className="w-5 h-5" /> </button>
</button> </Tooltip>
</Tooltip> )}
</div> </div>
) )
}, },