diff --git a/src/components/Activities/AttendLogs.jsx b/src/components/Activities/AttendLogs.jsx index 0ae97b8f..b246768b 100644 --- a/src/components/Activities/AttendLogs.jsx +++ b/src/components/Activities/AttendLogs.jsx @@ -2,27 +2,12 @@ import React, { useEffect, useState } from "react"; import { useEmployeeAttendacesLog } from "../../hooks/useAttendance"; import { convertShortTime } from "../../utils/dateUtils"; import { useNavigate } from "react-router-dom"; -import {THRESH_HOLD} from "../../utils/constants"; const AttendLogs = ({ Id }) => { const { logs, loading } = useEmployeeAttendacesLog(Id); const navigate = useNavigate(); - const isCheckoutRegularized = ( - activityTimeStr, - checkoutTimeStr, - threshHours - )=> { - if (!activityTimeStr || !checkoutTimeStr) return false; - - const activityTime = new Date(activityTimeStr); - const checkoutTime = new Date(checkoutTimeStr); - const threshTimeMs = threshHours * 60 * 60 * 1000; - - return checkoutTime - activityTime > threshTimeMs; - } - - const whichActivityPerform = (actvity,checkOutTime) => { + const whichActivityPerform = (actvity) => { switch (actvity) { case 1: return ( @@ -39,12 +24,12 @@ const AttendLogs = ({ Id }) => { case 2: return ( ); break; @@ -56,43 +41,27 @@ const AttendLogs = ({ Id }) => { data-bs-offset="0,8" data-bs-placement="top" data-bs-custom-class="tooltip" - title="Request Deleted!" + title="Regularized" > ); break; case 4: - if ( - checkOutTime && - isCheckoutRegularized(logs[0]?.activityTime, checkOutTime, THRESH_HOLD) - ) { - return ( - - ); - } else { - return ( - - ); - } + return ( + + ); break; case 5: return ( { const url = `https://www.google.com/maps?q=${lat},${lng}`; window.open(url, "_blank"); // Open in new tab }; - useEffect(() => { const tooltipTriggerList = Array.from( document.querySelectorAll('[data-bs-toggle="tooltip"]') @@ -154,11 +122,11 @@ const AttendLogs = ({ Id }) => { {log.activityTime.slice(0, 10)} {convertShortTime(log.activityTime)} - {whichActivityPerform(log.activity,log.activityTime)} + {whichActivityPerform(log.activity)} {log?.latitude != 0 ? (