Feat:Added loader animation
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user