handled loading properly
This commit is contained in:
parent
7ef148ac32
commit
9802746267
@ -67,6 +67,7 @@ const AttendanceLog = ({ handleModalData, projectId }) => {
|
||||
}
|
||||
}, [ dateRange, projectId, isRefreshing ] );
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
@ -83,11 +84,12 @@ const AttendanceLog = ({ handleModalData, projectId }) => {
|
||||
}`}
|
||||
title="Refresh"
|
||||
onClick={() => setIsRefreshing( !isRefreshing )}
|
||||
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="table-responsive text-nowrap">
|
||||
{data && data.length > 0 ? (
|
||||
{(data && data.length > 0 ) && (
|
||||
<table className="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -107,13 +109,6 @@ const AttendanceLog = ({ handleModalData, projectId }) => {
|
||||
</thead>
|
||||
<tbody>
|
||||
{loading && <td colSpan={5}>Loading...</td>}
|
||||
{error && <td colSpan={5}>{error}</td>}
|
||||
{data && data.length === 0 && (
|
||||
<tr>
|
||||
<td colSpan={5}>No Data Found</td>
|
||||
</tr>
|
||||
)}
|
||||
|
||||
{currentItems?.map( ( attendance, index ) => (
|
||||
<tr key={index}>
|
||||
<td colSpan={2}>
|
||||
@ -153,9 +148,11 @@ const AttendanceLog = ({ handleModalData, projectId }) => {
|
||||
) )}
|
||||
</tbody>
|
||||
</table>
|
||||
) : (
|
||||
<span>No employee logs</span>
|
||||
) }
|
||||
{(!loading && data.length === 0) &&
|
||||
<span>No employee logs</span>
|
||||
}
|
||||
{error && <td colSpan={5}>{error}</td>}
|
||||
</div>
|
||||
{!loading && (
|
||||
<nav aria-label="Page ">
|
||||
|
Loading…
x
Reference in New Issue
Block a user