diff --git a/src/app/assign_zone_project/AssignProject.jsx b/src/app/assign_zone_project/AssignProject.jsx new file mode 100644 index 0000000000000000000000000000000000000000..8e9ac5407ce08249e51f55ee0368ee87f0de235a --- /dev/null +++ b/src/app/assign_zone_project/AssignProject.jsx @@ -0,0 +1,112 @@ +"use client" +import React, { useState, useEffect } from 'react' +import Loader from '@/components/Loader/Loader' +import fetchRequest from '../lib/fetchRequest' +import { useNotification } from '@/context/NotificationContext' +import CancelIcon from "@/static/image/svg/cancel.svg" +import UserIcon from "@/static/image/svg/user.svg" +import DeskIcon from "@/static/image/svg/study-desk.svg" + + +const AssignProject = ({ setIsOpen }) => { + + return ( +
| + Date + | ++ Plateau + | ++ Projet + | ++ Places occupées + | ++ Nombre des personnes + | ++ Places disponible + | ++ Actions + | +
|---|---|---|---|---|---|---|
| + Apple MacBook Pro 17" + | ++ Silver + | ++ Laptop + | ++ $2999 + | ++ $2999 + | ++ $2999 + | ++ Edit + | +
| + Apple MacBook Pro 17" + | ++ Silver + | ++ Laptop + | ++ $2999 + | ++ $2999 + | ++ $2999 + | ++ Edit + | +
| + Apple MacBook Pro 17" + | ++ Silver + | ++ Laptop + | ++ $2999 + | ++ $2999 + | ++ $2999 + | ++ Edit + | +
| Semaine / Jour | +Semaine/Jour | J1 | J2 | J3 | @@ -40,19 +23,20 @@ const PlanningTable = ({ data, onTypePresenceChange }) => {
|---|---|---|---|---|
| {row.week} | +||||
| Semaine {row.week} | {row.days.map((day, dayIndex) => ( -- + | + | ))}
diff --git a/src/app/planning/type-presence/page.jsx b/src/app/planning/type-presence/page.jsx
new file mode 100644
index 0000000000000000000000000000000000000000..2f383cf8af8fac1879dd2893cdcbb684ef6a662b
--- /dev/null
+++ b/src/app/planning/type-presence/page.jsx
@@ -0,0 +1,62 @@
+"use client";
+
+import {useEffect, useState} from 'react';
+import fetchRequest from "@/app/lib/fetchRequest";
+import EntityList from "@/app/planning/type-presence/EntityList";
+import EntityForm from "@/app/planning/type-presence/EntityForm";
+import {useNotification} from "@/context/NotificationContext";
+
+const ManagePage = () => {
+ const [typePresences, setTypePresences] = useState([]);
+ const [editingEntity, setEditingEntity] = useState({ entity: null, id: null });
+ const { toggleNotification } = useNotification()
+
+ const fetchData = async () => {
+ const typePresencesResponse = await fetchRequest('/type-presences/');
+
+ if (typePresencesResponse.isSuccess) setTypePresences(typePresencesResponse.data);
+ };
+
+ useEffect(() => {
+ fetchData();
+ }, []);
+
+ const handleDelete = async (endpoint, id, setState, currentState) => {
+ const response = await fetchRequest(`/${endpoint}/${id}/`, {method: 'DELETE'});
+ if (response.isSuccess) {
+ setState(currentState.filter(item => item.id !== id));
+ toggleNotification({
+ visible: true,
+ message: `${currentState.find(item => item.id === id).nom} a été supprimé avec succès`,
+ type: "success"
+ })
+ }
+ await fetchData();
+ };
+
+ return (
+ <>
+ Gérer Les Entités+
+
+ >
+ );
+};
+
+export default ManagePage;
diff --git a/src/app/projects/ProjectForm.jsx b/src/app/projects/ProjectForm.jsx
index 0c4f1d1c4d52d89123f26d592f4f6dbfc749fd24..425cb09badb9664502865be810eaf05a12cc5fe6 100644
--- a/src/app/projects/ProjectForm.jsx
+++ b/src/app/projects/ProjectForm.jsx
@@ -87,7 +87,7 @@ const ProjectForm = ({ onAddProject, onEditProject, editingProject, setEditingPr
};
return (
-
+
+ Type Presence+ |