From 4f9fa1b7c23ab45b135b51d3f0887ca3337ac808 Mon Sep 17 00:00:00 2001 From: Vikas Nale Date: Mon, 15 Dec 2025 11:08:27 +0530 Subject: [PATCH] Add link to he project from Attendance details widget --- .../Dashboard/ProjectWiseTeamCount.jsx | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/components/Dashboard/ProjectWiseTeamCount.jsx b/src/components/Dashboard/ProjectWiseTeamCount.jsx index a7928fb6..c21c4bf5 100644 --- a/src/components/Dashboard/ProjectWiseTeamCount.jsx +++ b/src/components/Dashboard/ProjectWiseTeamCount.jsx @@ -7,8 +7,14 @@ import DatePicker from "../common/DatePicker"; import { useAppForm, useAppWatch } from "../../hooks/appHooks/useAppForm"; import { zodResolver } from "@hookform/resolvers/zod"; import { z } from "zod"; +import { setProjectId } from "../../slices/localVariablesSlice"; +import { useDispatch } from "react-redux"; +import { useNavigate } from "react-router-dom"; const ProjectWiseTeamCount = () => { + const dispatch = useDispatch(); + const navigate = useNavigate(); + const { control } = useAppForm({ resolver: zodResolver( z.object({ @@ -20,6 +26,11 @@ const ProjectWiseTeamCount = () => { }, }); + const goToProject = (projectId) => () => { + dispatch(setProjectId(projectId)); + navigate(`/projects/details`); + }; + const selectedDate = useAppWatch({ control, name: "date" }); const { data, isLoading, isFetching, isError, error } = @@ -72,11 +83,21 @@ const ProjectWiseTeamCount = () => { className="d-flex align-items-center text-wrap my-2 text-start" style={{ width: "180px" }} > - {item.projectName} + + {" "} + {item.projectName} + - {item.teamCount} - {item.attendanceCount} + + {item.teamCount} + + + {item.attendanceCount} + {/* {percent(item.teamCount, item.attendanceCount)}% */} ))}