feat: Affichage d'icones dans le tableau des inscriptions dans la

colonne actions
This commit is contained in:
N3WT DE COMPET
2025-03-31 20:24:05 +02:00
parent d6edf250bb
commit 9559db59eb

View File

@ -577,67 +577,39 @@ useEffect(()=>{
const actions = { const actions = {
1: [ 1: [
{ {
label: ( icon: <Send className="w-5 h-5 text-blue-500 hover:text-blue-700" />,
<>
<Send size={16} className="mr-2" /> Envoyer
</>
),
onClick: () => sendConfirmRegisterForm(row.student.id, row.student.last_name, row.student.first_name), onClick: () => sendConfirmRegisterForm(row.student.id, row.student.last_name, row.student.first_name),
}, },
{ {
label: ( icon: <Edit className="w-5 h-5 text-green-500 hover:text-green-700" />,
<>
<Edit size={16} className="mr-2" /> Modifier
</>
),
onClick: () => window.location.href = `${FE_ADMIN_SUBSCRIPTIONS_EDIT_URL}?studentId=${row.student.id}&id=1`, onClick: () => window.location.href = `${FE_ADMIN_SUBSCRIPTIONS_EDIT_URL}?studentId=${row.student.id}&id=1`,
}, },
], ],
2: [ 2: [
{ {
label: ( icon: <Edit className="w-5 h-5 text-green-500 hover:text-green-700" />,
<>
<Edit size={16} className="mr-2" /> Modifier
</>
),
onClick: () => window.location.href = `${FE_ADMIN_SUBSCRIPTIONS_EDIT_URL}?studentId=${row.student.id}&id=1`, onClick: () => window.location.href = `${FE_ADMIN_SUBSCRIPTIONS_EDIT_URL}?studentId=${row.student.id}&id=1`,
}, },
], ],
3: [ 3: [
{ {
label: ( icon: <CheckCircle className="w-5 h-5 text-emerald-500 hover:text-emerald-700" />,
<>
<CheckCircle size={16} className="mr-2" /> Valider
</>
),
onClick: () => openModalAssociationEleve(row.student), onClick: () => openModalAssociationEleve(row.student),
}, },
{ {
label: ( icon: <TicketX className="w-5 h-5 text-red-500 hover:text-red-700" />,
<>
<TicketX size={16} className="mr-2 text-red-700" /> Refuser
</>
),
onClick: () => refuseRegistrationForm(row.student.id, row.student.last_name, row.student.first_name, row.student.guardians[0].associated_profile_email), onClick: () => refuseRegistrationForm(row.student.id, row.student.last_name, row.student.first_name, row.student.guardians[0].associated_profile_email),
}, },
], ],
5: [ 5: [
{ {
label: ( icon: <CheckCircle className="w-5 h-5 text-emerald-500 hover:text-emerald-700" />,
<>
<CheckCircle size={16} className="mr-2" /> Rattacher
</>
),
onClick: () => openModalAssociationEleve(row.student), onClick: () => openModalAssociationEleve(row.student),
}, },
], ],
default: [ default: [
{ {
label: ( icon: <Trash2 className="w-5 h-5 text-red-500 hover:text-red-700" />,
<>
<Trash2 size={16} className="mr-2 text-red-700" /> Archiver
</>
),
onClick: () => archiveFicheInscription(row.student.id, row.student.last_name, row.student.first_name), onClick: () => archiveFicheInscription(row.student.id, row.student.last_name, row.student.first_name),
}, },
], ],
@ -688,13 +660,19 @@ const columns = [
) }, ) },
{ name: 'Actions', { name: 'Actions',
transform: (row) => ( transform: (row) => (
<DropdownMenu <div className="flex justify-center space-x-2">
buttonContent={<MoreVertical size={20} className="text-gray-400 hover:text-gray-600" />} {getActionsByStatus(row).map((action, index) => (
items={getActionsByStatus(row)} <button
buttonClassName="text-gray-400 hover:text-gray-600" key={index}
menuClassName="absolute right-0 mt-2 w-48 bg-white border border-gray-200 rounded-md shadow-lg z-10 flex flex-col items-center" onClick={action.onClick}
/> className="p-2 rounded-full hover:bg-gray-100 transition"
), }, >
{action.icon}
</button>
))}
</div>
),
},
]; ];