diff --git a/src/components/Organization/ViewOrganization.jsx b/src/components/Organization/ViewOrganization.jsx index 4fc4d6ec..7ac29f99 100644 --- a/src/components/Organization/ViewOrganization.jsx +++ b/src/components/Organization/ViewOrganization.jsx @@ -22,9 +22,8 @@ const VieworgDataanization = ({ orgId }) => {
{data?.isActive ? "Active" : "In-Active"}{" "} @@ -105,9 +104,101 @@ const VieworgDataanization = ({ orgId }) => {
{data?.address}
-
- {" "} - Projects And Services +
+ + + {/* remove "show" from className */} +
+ {data?.projects && data.projects.length > 0 ? ( + data.projects + .reduce((acc, curr) => { + const projectId = curr.project.id; + if (!acc.find((p) => p.id === projectId)) { + acc.push(curr.project); + } + return acc; + }, []) + .map((project) => ( +
+ + +
+ {data.projects + .filter((p) => p.project.id === project.id) + .map((p) => ( +
+ + {p.service.name} +
+ ))} +
+
+ )) + ) : ( +
No projects available
+ )} +
+
+ + {/* Services Section */} +
+ + + {/* collapse is closed initially */} +
+ {data?.services && data.services.length > 0 ? ( +
+ {data.services.map((service) => ( +
+
+
+
+ + {service.name} +
+

+ {service.description || "No description available."} +

+
+
+
+ ))} +
+ ) : ( +
No services available
+ )} +
);