diff --git a/client/src/components/Buyer/Contract/ContractList.jsx b/client/src/components/Buyer/Contract/ContractList.jsx
new file mode 100644
index 0000000..43be031
--- /dev/null
+++ b/client/src/components/Buyer/Contract/ContractList.jsx
@@ -0,0 +1,70 @@
+import { useContext, useEffect, useState } from 'react';
+import { AuthContext } from '../../context/Authcontext';
+import { db } from '../../../../firebase';
+import { doc, getDoc } from 'firebase/firestore';
+import ContractStatus from './ContractStatus';
+
+const ContractList = () => {
+ const [contracts, setContracts] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState(null);
+ const { currentUser } = useContext(AuthContext);
+
+ useEffect(() => {
+ const fetchContracts = async () => {
+ if (!currentUser) {
+ setError('User not authenticated');
+ setLoading(false);
+ return;
+ }
+
+ try {
+ const buyerRef = doc(db, 'buyers', currentUser.uid);
+ const docSnap = await getDoc(buyerRef);
+
+ if (docSnap.exists()) {
+ const contractsData = docSnap.data().contracts || [];
+ setContracts(contractsData);
+ } else {
+ setError('No buyer profile found');
+ }
+ } catch (err) {
+ console.error('Error fetching contracts:', err);
+ setError('Failed to fetch contracts');
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ fetchContracts();
+ }, [currentUser]);
+
+ if (loading) {
+ return
Loading contracts...
;
+ }
+
+ if (error) {
+ return {error}
;
+ }
+
+ return (
+
+
+ Your Contracts
+
+ {contracts.length === 0 ? (
+
No contracts found.
+ ) : (
+
+ {contracts
+ .sort((a, b) => b.contractId - a.contractId) // Sort contracts by contractId in decreasing order
+ .map((contract) => (
+
+ ))}
+
+ )}
+
+ );
+};
+
+export default ContractList;
diff --git a/client/src/components/Farmer/FarmSell.jsx b/client/src/components/Farmer/FarmSell.jsx
index 6510f7b..d71e728 100644
--- a/client/src/components/Farmer/FarmSell.jsx
+++ b/client/src/components/Farmer/FarmSell.jsx
@@ -15,7 +15,6 @@ function Box({ crop }) {
@@ -27,11 +26,6 @@ function Details({ crops, setSelectedCrop, handleInputChange }) {
@@ -134,14 +113,6 @@ function Details({ crops, setSelectedCrop, handleInputChange }) {
onChange={handleInputChange}
required
/>
-
@@ -154,14 +125,6 @@ function Details({ crops, setSelectedCrop, handleInputChange }) {
onChange={handleInputChange}
required
/>
-
@@ -174,14 +137,6 @@ function Details({ crops, setSelectedCrop, handleInputChange }) {
onChange={handleInputChange}
required
/>
-
@@ -218,27 +173,6 @@ function Search({ searchQuery, setSearchQuery, handleSearch }) {
onChange={(e) => setSearchQuery(e.target.value)}
/>