changed hook name , replaced properly related logic name

This commit is contained in:
Pramod Mahajan 2025-06-14 10:46:33 +05:30
parent dee44c63aa
commit f48d05ecee

View File

@ -21,7 +21,7 @@ import { REGULARIZE_ATTENDANCE } from "../../utils/constants";
const AttendancePage = () => { const AttendancePage = () => {
const [activeTab, setActiveTab] = useState("all"); const [activeTab, setActiveTab] = useState("all");
const [showOnlyCheckout, setShowOnlyCheckout] = useState(); const [ShowPending, setShowPending] = useState(false);
const loginUser = getCachedProfileData(); const loginUser = getCachedProfileData();
var selectedProject = useSelector((store) => store.localVariables.projectId); var selectedProject = useSelector((store) => store.localVariables.projectId);
// const { projects, loading: projectLoading } = useProjects(); // const { projects, loading: projectLoading } = useProjects();
@ -111,7 +111,7 @@ const AttendancePage = () => {
// (att) => att?.checkOutTime !== null && att?.checkInTime !== null // (att) => att?.checkOutTime !== null && att?.checkInTime !== null
// ) // )
// : attendances; // : attendances;
const filteredAttendance = showOnlyCheckout const filteredAttendance = ShowPending
? attendances?.filter((att) => att?.checkInTime !== null && att?.checkOutTime === null) ? attendances?.filter((att) => att?.checkInTime !== null && att?.checkOutTime === null)
: attendances; : attendances;
@ -227,12 +227,12 @@ const AttendancePage = () => {
attendance={filteredAttendance} attendance={filteredAttendance}
handleModalData={handleModalData} handleModalData={handleModalData}
getRole={getRole} getRole={getRole}
setshowOnlyCheckout={setShowOnlyCheckout} setshowOnlyCheckout={setShowPending}
showOnlyCheckout={showOnlyCheckout} showOnlyCheckout={ShowPending}
/> />
</div> </div>
{!attLoading && filteredAttendance?.length === 0 && ( {!attLoading && filteredAttendance?.length === 0 && (
<p>No Employee assigned yet.</p> <p> {ShowPending ? "No Pending Available" : "No Employee assigned yet."} </p>
)} )}
</> </>
)} )}
@ -242,8 +242,8 @@ const AttendancePage = () => {
<AttendanceLog <AttendanceLog
handleModalData={handleModalData} handleModalData={handleModalData}
projectId={selectedProject} projectId={selectedProject}
setshowOnlyCheckout={setShowOnlyCheckout} setshowOnlyCheckout={setShowPending}
showOnlyCheckout={showOnlyCheckout} showOnlyCheckout={ShowPending}
/> />
</div> </div>
)} )}