changed hook name , replaced properly related logic name
This commit is contained in:
parent
dee44c63aa
commit
f48d05ecee
@ -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>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user