Fix loading error. Hide existing content and then show loading

This commit is contained in:
Vikas Nale 2025-04-17 17:52:09 +05:30
parent 1418f84976
commit b963f6bad9

View File

@ -34,7 +34,9 @@ const Regularization = ({ handleRequest }) => {
</thead>
<tbody>
{loading && <td colSpan={5}>Loading...</td>}
{regularizes?.length > 0 ? (
{!loading &&
(regularizes?.length > 0 ? (
regularizes?.map((att, index) => (
<tr key={index}>
<td colSpan={2}>
@ -55,7 +57,9 @@ const Regularization = ({ handleRequest }) => {
<td>{moment(att.checkOutTime).format("DD-MMM-YYYY")}</td>
<td>{convertShortTime(att.checkInTime)}</td>
<td>
{att.checkOutTime ? convertShortTime(att.checkOutTime) : "--"}
{att.checkOutTime
? convertShortTime(att.checkOutTime)
: "--"}
</td>
<td className="text-center ">
{/* <div className='d-flex justify-content-center align-items-center gap-3'> */}
@ -72,7 +76,7 @@ const Regularization = ({ handleRequest }) => {
<tr>
<td colSpan={5}>No Record Found</td>
</tr>
)}
))}
</tbody>
</table>
</div>