feat: Ajout de la sélection des modes de paiements / refactoring de

l'automate
This commit is contained in:
N3WT DE COMPET
2025-04-06 20:45:41 +02:00
parent 9559db59eb
commit 5a7661db93
19 changed files with 286 additions and 190 deletions

View File

@ -10,7 +10,7 @@ import Loader from '@/components/Loader';
import AlertWithModal from '@/components/AlertWithModal';
import DropdownMenu from "@/components/DropdownMenu";
import { formatPhoneNumber } from '@/utils/Telephone';
import { MoreVertical, Send, Edit, Trash2, FileText, CheckCircle, Plus, TicketX } from 'lucide-react';
import { MoreVertical, Send, Edit, Archive, FileText, CircleCheck, Plus, XCircle } from 'lucide-react';
import Modal from '@/components/Modal';
import InscriptionForm from '@/components/Inscription/InscriptionForm'
import AffectationClasseForm from '@/components/AffectationClasseForm'
@ -68,7 +68,7 @@ export default function Page({ params: { locale } }) {
const [totalPending, setTotalPending] = useState(0);
const [totalSubscribed, setTotalSubscribed] = useState(0);
const [totalArchives, setTotalArchives] = useState(0);
const [itemsPerPage, setItemsPerPage] = useState(5); // Définir le nombre d'éléments par page
const [itemsPerPage, setItemsPerPage] = useState(10); // Définir le nombre d'éléments par page
const [templateMasters, setTemplateMasters] = useState([]);
const [isOpen, setIsOpen] = useState(false);
@ -577,39 +577,39 @@ useEffect(()=>{
const actions = {
1: [
{
icon: <Send className="w-5 h-5 text-blue-500 hover:text-blue-700" />,
onClick: () => sendConfirmRegisterForm(row.student.id, row.student.last_name, row.student.first_name),
icon: <Edit className="w-5 h-5 text-blue-500 hover:text-blue-700" />,
onClick: () => window.location.href = `${FE_ADMIN_SUBSCRIPTIONS_EDIT_URL}?studentId=${row.student.id}&id=1`,
},
{
icon: <Edit className="w-5 h-5 text-green-500 hover:text-green-700" />,
onClick: () => window.location.href = `${FE_ADMIN_SUBSCRIPTIONS_EDIT_URL}?studentId=${row.student.id}&id=1`,
icon: <Send className="w-5 h-5 text-green-500 hover:text-green-700" />,
onClick: () => sendConfirmRegisterForm(row.student.id, row.student.last_name, row.student.first_name),
},
],
2: [
{
icon: <Edit className="w-5 h-5 text-green-500 hover:text-green-700" />,
icon: <Edit className="w-5 h-5 text-blue-500 hover:text-blue-700" />,
onClick: () => window.location.href = `${FE_ADMIN_SUBSCRIPTIONS_EDIT_URL}?studentId=${row.student.id}&id=1`,
},
],
3: [
{
icon: <CheckCircle className="w-5 h-5 text-emerald-500 hover:text-emerald-700" />,
icon: <CircleCheck className="w-5 h-5 text-green-500 hover:text-green-700" />,
onClick: () => openModalAssociationEleve(row.student),
},
{
icon: <TicketX className="w-5 h-5 text-red-500 hover:text-red-700" />,
icon: <XCircle className="w-5 h-5 text-red-500 hover:text-red-700" />,
onClick: () => refuseRegistrationForm(row.student.id, row.student.last_name, row.student.first_name, row.student.guardians[0].associated_profile_email),
},
],
5: [
{
icon: <CheckCircle className="w-5 h-5 text-emerald-500 hover:text-emerald-700" />,
icon: <CircleCheck className="w-5 h-5 text-green-500 hover:text-green-700" />,
onClick: () => openModalAssociationEleve(row.student),
},
],
default: [
{
icon: <Trash2 className="w-5 h-5 text-red-500 hover:text-red-700" />,
icon: <Archive className="w-5 h-5 text-gray-500 hover:text-gray-700" />,
onClick: () => archiveFicheInscription(row.student.id, row.student.last_name, row.student.first_name),
},
],
@ -703,14 +703,14 @@ const columnsSubscribed = [
items={[
{ label: (
<>
<CheckCircle size={16} className="mr-2" /> Rattacher
<CircleCheck size={16} className="mr-2" /> Rattacher
</>
),
onClick: () => openModalAssociationEleve(row.student)
},
{ label: (
<>
<Trash2 size={16} className="mr-2 text-red-700" /> Archiver
<Archive size={16} className="mr-2 text-red-700" /> Archiver
</>
),
onClick: () => archiveFicheInscription(row.student.id, row.student.last_name, row.student.first_name),