import React, { useEffect, useState } from "react"; import Avatar from "../common/Avatar"; import { convertShortTime } from "../../utils/dateUtils"; import RegularizationActions from "./RegularizationActions"; import { useSelector } from "react-redux"; import { useRegularizationRequests } from "../../hooks/useAttendance"; import moment from "moment"; const Regularization = ({ handleRequest }) => { var selectedProject = useSelector((store) => store.localVariables.projectId); const [regularizesList, setregularizedList] = useState([]); const { regularizes, loading, error, refetch } = useRegularizationRequests(selectedProject); useEffect(() => { setregularizedList(regularizes); }, [regularizes]); return (
{loading && } {!loading && (regularizes?.length > 0 ? ( regularizes?.map((att, index) => ( )) ) : ( ))}
Name Date Check-In Check-Out Action
Loading...
{moment(att.checkOutTime).format("DD-MMM-YYYY")} {convertShortTime(att.checkInTime)} {att.checkOutTime ? convertShortTime(att.checkOutTime) : "--"} {/*
*/} {/*
*/}
No Record Found
); }; export default Regularization;