Feat:Added loader animation

This commit is contained in:
2025-02-23 07:33:20 +05:30
parent fcc52ed62a
commit 36911b5701
2 changed files with 126 additions and 52 deletions
@@ -1,4 +1,5 @@
import React, { useState, useEffect } from "react";
import Laoder from "../../../components/Laoder";
const CropTable = ({ farmId }) => {
const [crops, setCrops] = useState([]);
@@ -48,11 +49,7 @@ const CropTable = ({ farmId }) => {
}, []);
if (loading) {
return (
<div className="flex justify-center items-center min-h-[400px]">
Loading crops...
</div>
);
return <Laoder></Laoder>;
}
if (error) {
@@ -161,7 +158,7 @@ const CropTable = ({ farmId }) => {
<div className="text-sm text-gray-900">
<button
type="button"
class="focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"
className="focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"
onClick={() => handleRemoveCrop(crop._id)}
>
Remove