diff --git a/Frontend/src/components/FarmList.jsx b/Frontend/src/components/FarmList.jsx index f9cb090..8b647d0 100644 --- a/Frontend/src/components/FarmList.jsx +++ b/Frontend/src/components/FarmList.jsx @@ -1,122 +1,52 @@ +import { useEffect, useState } from "react"; +import Td from "./Td"; + const FarmList = () => { + const [data, setData] = useState([]); + + useEffect(() => { + fetch("http://localhost:8000/api/v1/farm", { + credentials: "include", + method: "GET", + headers: { "Content-Type": "application/json" }, + }) + .then((response) => response.json()) + .then((data) => setData(data)) + .catch((error) => console.error(error)); + }, []); + return ( -
- - +
+
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + {data.length > 0 ? ( + data.map((item) => + + + )}
+ Farm name + Location + Type + Size (acres) + Action
- Green Valley Farms - CaliforniaOrganic150 - - Edit - -
- Sunny Acres - TexasConventional200 - - Edit - -
- Riverside Estates - FloridaHydroponic120 - - Edit - -
- Blueberry Hill - OregonBerry80 - - Edit - -
- Sunnybrook Meadows - WashingtonDairy300 - - Edit - -
) + ) : ( +
+ No data available +
diff --git a/Frontend/src/components/TotalSpent.jsx b/Frontend/src/components/TotalSpent.jsx index 09944e4..e4d0c75 100644 --- a/Frontend/src/components/TotalSpent.jsx +++ b/Frontend/src/components/TotalSpent.jsx @@ -5,6 +5,33 @@ const TotalSpent = () => { href="#" className="h-full block max-w-sm p-6 bg-no-repeat bg-center bg-cover border border-gray-200 rounded-lg shadow-sm hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700" > +
+ + + + + + + + + + + + + +
100,000