mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
104 lines
2.9 KiB
JavaScript
104 lines
2.9 KiB
JavaScript
import React, { useState, useEffect } from 'react';
|
|
import SpecialitiesSection from '@/components/Structure/Configuration/SpecialitiesSection';
|
|
import TeachersSection from '@/components/Structure/Configuration/TeachersSection';
|
|
import ClassesSection from '@/components/Structure/Configuration/ClassesSection';
|
|
import { ClassesProvider } from '@/context/ClassesContext';
|
|
import {
|
|
BE_SCHOOL_SPECIALITIES_URL,
|
|
BE_SCHOOL_TEACHERS_URL,
|
|
BE_SCHOOL_SCHOOLCLASSES_URL,
|
|
} from '@/utils/Url';
|
|
|
|
const StructureManagement = ({
|
|
specialities,
|
|
setSpecialities,
|
|
teachers,
|
|
setTeachers,
|
|
classes,
|
|
setClasses,
|
|
profiles,
|
|
handleCreate,
|
|
handleEdit,
|
|
handleDelete,
|
|
}) => {
|
|
return (
|
|
<div className="w-full">
|
|
<ClassesProvider>
|
|
<div className="mt-8 w-2/5">
|
|
<SpecialitiesSection
|
|
specialities={specialities}
|
|
setSpecialities={setSpecialities}
|
|
handleCreate={(newData) =>
|
|
handleCreate(
|
|
`${BE_SCHOOL_SPECIALITIES_URL}`,
|
|
newData,
|
|
setSpecialities
|
|
)
|
|
}
|
|
handleEdit={(id, updatedData) =>
|
|
handleEdit(
|
|
`${BE_SCHOOL_SPECIALITIES_URL}`,
|
|
id,
|
|
updatedData,
|
|
setSpecialities
|
|
)
|
|
}
|
|
handleDelete={(id) =>
|
|
handleDelete(`${BE_SCHOOL_SPECIALITIES_URL}`, id, setSpecialities)
|
|
}
|
|
/>
|
|
</div>
|
|
<div className="w-4/5 mt-12">
|
|
<TeachersSection
|
|
teachers={teachers}
|
|
setTeachers={setTeachers}
|
|
specialities={specialities}
|
|
profiles={profiles}
|
|
handleCreate={(newData) =>
|
|
handleCreate(`${BE_SCHOOL_TEACHERS_URL}`, newData, setTeachers)
|
|
}
|
|
handleEdit={(id, updatedData) =>
|
|
handleEdit(
|
|
`${BE_SCHOOL_TEACHERS_URL}`,
|
|
id,
|
|
updatedData,
|
|
setTeachers
|
|
)
|
|
}
|
|
handleDelete={(id) =>
|
|
handleDelete(`${BE_SCHOOL_TEACHERS_URL}`, id, setTeachers)
|
|
}
|
|
/>
|
|
</div>
|
|
<div className="w-full mt-12">
|
|
<ClassesSection
|
|
classes={classes}
|
|
setClasses={setClasses}
|
|
teachers={teachers}
|
|
handleCreate={(newData) =>
|
|
handleCreate(
|
|
`${BE_SCHOOL_SCHOOLCLASSES_URL}`,
|
|
newData,
|
|
setClasses
|
|
)
|
|
}
|
|
handleEdit={(id, updatedData) =>
|
|
handleEdit(
|
|
`${BE_SCHOOL_SCHOOLCLASSES_URL}`,
|
|
id,
|
|
updatedData,
|
|
setClasses
|
|
)
|
|
}
|
|
handleDelete={(id) =>
|
|
handleDelete(`${BE_SCHOOL_SCHOOLCLASSES_URL}`, id, setClasses)
|
|
}
|
|
/>
|
|
</div>
|
|
</ClassesProvider>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default StructureManagement;
|