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 [activeTab, setActiveTab] = useState("all");
|
||||
const [showOnlyCheckout, setShowOnlyCheckout] = useState();
|
||||
const [ShowPending, setShowPending] = useState(false);
|
||||
const loginUser = getCachedProfileData();
|
||||
var selectedProject = useSelector((store) => store.localVariables.projectId);
|
||||
// const { projects, loading: projectLoading } = useProjects();
|
||||
@ -111,7 +111,7 @@ const AttendancePage = () => {
|
||||
// (att) => att?.checkOutTime !== null && att?.checkInTime !== null
|
||||
// )
|
||||
// : attendances;
|
||||
const filteredAttendance = showOnlyCheckout
|
||||
const filteredAttendance = ShowPending
|
||||
? attendances?.filter((att) => att?.checkInTime !== null && att?.checkOutTime === null)
|
||||
: attendances;
|
||||
|
||||
@ -227,12 +227,12 @@ const AttendancePage = () => {
|
||||
attendance={filteredAttendance}
|
||||
handleModalData={handleModalData}
|
||||
getRole={getRole}
|
||||
setshowOnlyCheckout={setShowOnlyCheckout}
|
||||
showOnlyCheckout={showOnlyCheckout}
|
||||
setshowOnlyCheckout={setShowPending}
|
||||
showOnlyCheckout={ShowPending}
|
||||
/>
|
||||
</div>
|
||||
{!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
|
||||
handleModalData={handleModalData}
|
||||
projectId={selectedProject}
|
||||
setshowOnlyCheckout={setShowOnlyCheckout}
|
||||
showOnlyCheckout={showOnlyCheckout}
|
||||
setshowOnlyCheckout={setShowPending}
|
||||
showOnlyCheckout={ShowPending}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user