diff --git a/src/components/ServiceProject/ServiceProjectBranch/ServiceBranch.jsx b/src/components/ServiceProject/ServiceProjectBranch/ServiceBranch.jsx
index 63bdb09c..4e9c6d6c 100644
--- a/src/components/ServiceProject/ServiceProjectBranch/ServiceBranch.jsx
+++ b/src/components/ServiceProject/ServiceProjectBranch/ServiceBranch.jsx
@@ -8,6 +8,7 @@ import { useParams } from "react-router-dom";
import Pagination from "../../common/Pagination";
import ConfirmModal from "../../common/ConfirmModal";
import { SpinnerLoader } from "../../common/Loader";
+import ViewBranchDetails from "./ViewBranchDetails";
const ServiceBranch = () => {
const { projectId } = useParams();
@@ -19,6 +20,7 @@ const ServiceBranch = () => {
});
const { mutate: DeleteBranch, isPending } = useDeleteBranch();
const [deletingId, setDeletingId] = useState(null);
+ const [ViewRequest, setViewRequest] = useState({ requestId: null, view: false });
const [search, setSearch] = useState("");
const [currentPage, setCurrentPage] = useState(1);
@@ -84,7 +86,7 @@ const ServiceBranch = () => {
- Branchs
+ Branches
@@ -171,37 +173,78 @@ const ServiceBranch = () => {
!isError &&
data?.data?.length > 0 &&
data.data.map((branch) => (
-
+
{
+ if (!showInactive && !e.target.closest(".dropdown") && !e.target.closest(".bx-show")) {
+ setViewRequest({ branchId: branch.id, view: true });
+ }
+ }}
+ >
+
{columns.map((col) => (
|
{col.getValue(branch)}
|
))}
- |
@@ -277,6 +308,17 @@ const ServiceBranch = () => {
/>
)}
+ {ViewRequest.view && (
+ setViewRequest({ branchId: null, view: false })}
+ >
+
+
+
+ )}
>
diff --git a/src/components/ServiceProject/ServiceProjectBranch/ViewBranchDetails.jsx b/src/components/ServiceProject/ServiceProjectBranch/ViewBranchDetails.jsx
new file mode 100644
index 00000000..db67ea8b
--- /dev/null
+++ b/src/components/ServiceProject/ServiceProjectBranch/ViewBranchDetails.jsx
@@ -0,0 +1,142 @@
+import React from "react";
+import { useBranchDetails } from "../../../hooks/useServiceProject";
+import Avatar from "../../common/Avatar";
+import { formatUTCToLocalTime } from "../../../utils/dateUtils";
+
+const ViewBranchDetails = ({ BranchToEdit }) => {
+ const { data, isLoading, isError, error: requestError } = useBranchDetails(BranchToEdit);
+
+ console.log("branch details:", data);
+
+ if (isLoading) return Loading...
;
+ if (isError) return Error: {requestError?.message}
;
+
+ return (
+
+ );
+};
+
+export default ViewBranchDetails;