feat: gestion des no data dans les table [#33]

This commit is contained in:
N3WT DE COMPET
2025-05-17 14:35:33 +02:00
parent 3990d75e52
commit 2888f8dcce
14 changed files with 258 additions and 103 deletions

View File

@ -16,6 +16,7 @@ import { FE_ADMIN_STRUCTURE_SCHOOLCLASS_MANAGEMENT_URL } from '@/utils/Url';
import { usePlanning } from '@/context/PlanningContext';
import { useClasses } from '@/context/ClassesContext';
import { useRouter } from 'next/navigation';
import AlertMessage from '@/components/AlertMessage';
const ItemTypes = {
TEACHER: 'teacher',
@ -544,6 +545,13 @@ const ClassesSection = ({
data={newClass ? [newClass, ...classes] : classes}
columns={columns}
renderCell={renderClassCell}
emptyMessage={
<AlertMessage
type="warning"
title="Aucune classe enregistrée"
message="Veuillez procéder à la création d'une nouvelle classe."
/>
}
/>
<Popup
visible={popupVisible}

View File

@ -9,6 +9,7 @@ import SpecialityItem from '@/components/Structure/Configuration/SpecialityItem'
import { useEstablishment } from '@/context/EstablishmentContext';
import logger from '@/utils/logger';
import SectionHeader from '@/components/SectionHeader';
import AlertMessage from '@/components/AlertMessage';
const SpecialitiesSection = ({
specialities,
@ -255,6 +256,13 @@ const SpecialitiesSection = ({
data={newSpeciality ? [newSpeciality, ...specialities] : specialities}
columns={columns}
renderCell={renderSpecialityCell}
emptyMessage={
<AlertMessage
type="warning"
title="Aucune spécialité enregistrée"
message="Veuillez procéder à la création d'une nouvelle spécialité."
/>
}
/>
<Popup
visible={popupVisible}

View File

@ -12,6 +12,7 @@ import TeacherItem from './TeacherItem';
import logger from '@/utils/logger';
import { useEstablishment } from '@/context/EstablishmentContext';
import SectionHeader from '@/components/SectionHeader';
import AlertMessage from '@/components/AlertMessage';
const ItemTypes = {
SPECIALITY: 'speciality',
@ -579,6 +580,13 @@ const TeachersSection = ({
data={newTeacher ? [newTeacher, ...teachers] : teachers}
columns={columns}
renderCell={renderTeacherCell}
emptyMessage={
<AlertMessage
type="warning"
title="Aucun enseignant enregistré"
message="Veuillez procéder à la création d'un nouvel enseignant."
/>
}
/>
<Popup
visible={popupVisible}