diff --git a/backend/package-lock.json b/backend/package-lock.json index 93f8554b..7f66d27b 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@google/generative-ai": "^0.21.0", "bcryptjs": "^2.4.3", "cors": "^2.8.5", "dotenv": "^16.0.3", @@ -1330,6 +1331,14 @@ "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" }, + "node_modules/@google/generative-ai": { + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@google/generative-ai/-/generative-ai-0.21.0.tgz", + "integrity": "sha512-7XhUbtnlkSEZK15kN3t+tzIMxsbKm/dSkKBFalj+20NvPKe1kBY7mR2P7vuijEn+f06z5+A8bVGKO0v39cr6Wg==", + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 41556de6..ac0e61ca 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -14,8 +14,10 @@ "@fortawesome/free-regular-svg-icons": "^6.6.0", "@fortawesome/free-solid-svg-icons": "^6.6.0", "@fortawesome/react-fontawesome": "^0.2.2", + "@google/generative-ai": "^0.21.0", "@headlessui/react": "^2.1.10", "@heroicons/react": "^2.1.5", + "@mui/icons-material": "^6.1.6", "@mui/material": "^6.1.3", "@radix-ui/react-hover-card": "^1.1.2", "@radix-ui/react-icons": "^1.3.0", @@ -317,9 +319,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.7.tgz", - "integrity": "sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", + "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -1059,6 +1061,14 @@ "react": ">=16.3" } }, + "node_modules/@google/generative-ai": { + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@google/generative-ai/-/generative-ai-0.21.0.tgz", + "integrity": "sha512-7XhUbtnlkSEZK15kN3t+tzIMxsbKm/dSkKBFalj+20NvPKe1kBY7mR2P7vuijEn+f06z5+A8bVGKO0v39cr6Wg==", + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@headlessui/react": { "version": "2.1.10", "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-2.1.10.tgz", @@ -1254,24 +1264,49 @@ } }, "node_modules/@mui/core-downloads-tracker": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-6.1.3.tgz", - "integrity": "sha512-ajMUgdfhTb++rwqj134Cq9f4SRN8oXUqMRnY72YBnXiXai3olJLLqETheRlq3MM8wCKrbq7g6j7iWL1VvP44VQ==", + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-6.1.6.tgz", + "integrity": "sha512-nz1SlR9TdBYYPz4qKoNasMPRiGb4PaIHFkzLzhju0YVYS5QSuFF2+n7CsiHMIDcHv3piPu/xDWI53ruhOqvZwQ==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + } + }, + "node_modules/@mui/icons-material": { + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-6.1.6.tgz", + "integrity": "sha512-5r9urIL2lxXb/sPN3LFfFYEibsXJUb986HhhIeu1gOcte460pwdSiEhBSxkAuyT8Dj7jvu9MjqSBmSumQELo8A==", + "dependencies": { + "@babel/runtime": "^7.26.0" + }, + "engines": { + "node": ">=14.0.0" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@mui/material": "^6.1.6", + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } } }, "node_modules/@mui/material": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-6.1.3.tgz", - "integrity": "sha512-loV5MBoMKLrK80JeWINmQ1A4eWoLv51O2dBPLJ260IAhupkB3Wol8lEQTEvvR2vO3o6xRHuXe1WaQEP6N3riqg==", - "dependencies": { - "@babel/runtime": "^7.25.6", - "@mui/core-downloads-tracker": "^6.1.3", - "@mui/system": "^6.1.3", - "@mui/types": "^7.2.18", - "@mui/utils": "^6.1.3", + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-6.1.6.tgz", + "integrity": "sha512-1yvejiQ/601l5AK3uIdUlAVElyCxoqKnl7QA+2oFB/2qYPWfRwDgavW/MoywS5Y2gZEslcJKhe0s2F3IthgFgw==", + "dependencies": { + "@babel/runtime": "^7.26.0", + "@mui/core-downloads-tracker": "^6.1.6", + "@mui/system": "^6.1.6", + "@mui/types": "^7.2.19", + "@mui/utils": "^6.1.6", "@popperjs/core": "^2.11.8", "@types/react-transition-group": "^4.4.11", "clsx": "^2.1.1", @@ -1290,7 +1325,7 @@ "peerDependencies": { "@emotion/react": "^11.5.0", "@emotion/styled": "^11.3.0", - "@mui/material-pigment-css": "^6.1.3", + "@mui/material-pigment-css": "^6.1.6", "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" @@ -1316,12 +1351,12 @@ "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" }, "node_modules/@mui/private-theming": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-6.1.3.tgz", - "integrity": "sha512-XK5OYCM0x7gxWb/WBEySstBmn+dE3YKX7U7jeBRLm6vHU5fGUd7GiJWRirpivHjOK9mRH6E1MPIVd+ze5vguKQ==", + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-6.1.6.tgz", + "integrity": "sha512-ioAiFckaD/fJSnTrUMWgjl9HYBWt7ixCh7zZw7gDZ+Tae7NuprNV6QJK95EidDT7K0GetR2rU3kAeIR61Myttw==", "dependencies": { - "@babel/runtime": "^7.25.6", - "@mui/utils": "^6.1.3", + "@babel/runtime": "^7.26.0", + "@mui/utils": "^6.1.6", "prop-types": "^15.8.1" }, "engines": { @@ -1342,11 +1377,11 @@ } }, "node_modules/@mui/styled-engine": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-6.1.3.tgz", - "integrity": "sha512-i4yh9m+eMZE3cNERpDhVr6Wn73Yz6C7MH0eE2zZvw8d7EFkIJlCQNZd1xxGZqarD2DDq2qWHcjIOucWGhxACtA==", + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-6.1.6.tgz", + "integrity": "sha512-I+yS1cSuSvHnZDBO7e7VHxTWpj+R7XlSZvTC4lS/OIbUNJOMMSd3UDP6V2sfwzAdmdDNBi7NGCRv2SZ6O9hGDA==", "dependencies": { - "@babel/runtime": "^7.25.6", + "@babel/runtime": "^7.26.0", "@emotion/cache": "^11.13.1", "@emotion/serialize": "^1.3.2", "@emotion/sheet": "^1.4.0", @@ -1375,15 +1410,15 @@ } }, "node_modules/@mui/system": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-6.1.3.tgz", - "integrity": "sha512-ILaD9UsLTBLjMcep3OumJMXh1PYr7aqnkHm/L47bH46+YmSL1zWAX6tWG8swEQROzW2GvYluEMp5FreoxOOC6w==", - "dependencies": { - "@babel/runtime": "^7.25.6", - "@mui/private-theming": "^6.1.3", - "@mui/styled-engine": "^6.1.3", - "@mui/types": "^7.2.18", - "@mui/utils": "^6.1.3", + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-6.1.6.tgz", + "integrity": "sha512-qOf1VUE9wK8syiB0BBCp82oNBAVPYdj4Trh+G1s+L+ImYiKlubWhhqlnvWt3xqMevR+D2h1CXzA1vhX2FvA+VQ==", + "dependencies": { + "@babel/runtime": "^7.26.0", + "@mui/private-theming": "^6.1.6", + "@mui/styled-engine": "^6.1.6", + "@mui/types": "^7.2.19", + "@mui/utils": "^6.1.6", "clsx": "^2.1.1", "csstype": "^3.1.3", "prop-types": "^15.8.1" @@ -1414,9 +1449,9 @@ } }, "node_modules/@mui/types": { - "version": "7.2.18", - "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.18.tgz", - "integrity": "sha512-uvK9dWeyCJl/3ocVnTOS6nlji/Knj8/tVqVX03UVTpdmTJYu/s4jtDd9Kvv0nRGE0CUSNW1UYAci7PYypjealg==", + "version": "7.2.19", + "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.19.tgz", + "integrity": "sha512-6XpZEM/Q3epK9RN8ENoXuygnqUQxE+siN/6rGRi2iwJPgBUR25mphYQ9ZI87plGh58YoZ5pp40bFvKYOCDJ3tA==", "peerDependencies": { "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0" }, @@ -1427,12 +1462,12 @@ } }, "node_modules/@mui/utils": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-6.1.3.tgz", - "integrity": "sha512-4JBpLkjprlKjN10DGb1aiy/ii9TKbQ601uSHtAmYFAS879QZgAD7vRnv/YBE4iBbc7NXzFgbQMCOFrupXWekIA==", + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-6.1.6.tgz", + "integrity": "sha512-sBS6D9mJECtELASLM+18WUcXF6RH3zNxBRFeyCRg8wad6NbyNrdxLuwK+Ikvc38sTZwBzAz691HmSofLqHd9sQ==", "dependencies": { - "@babel/runtime": "^7.25.6", - "@mui/types": "^7.2.18", + "@babel/runtime": "^7.26.0", + "@mui/types": "^7.2.19", "@types/prop-types": "^15.7.13", "clsx": "^2.1.1", "prop-types": "^15.8.1", diff --git a/frontend/src/AgroRentAI/NavigateProducts.jsx b/frontend/src/AgroRentAI/NavigateProducts.jsx index 46963e0c..fd7b846a 100644 --- a/frontend/src/AgroRentAI/NavigateProducts.jsx +++ b/frontend/src/AgroRentAI/NavigateProducts.jsx @@ -2,29 +2,41 @@ import React, { useState, useEffect } from 'react'; import { Search, ShoppingCart, ChevronDown, Star } from 'lucide-react'; import img1 from "../assets/116.jpg"; import axios from 'axios'; +import { useNavigate } from 'react-router-dom'; // Assuming the categories list is the same const categories = ['All', 'Farming Technology', 'Farming Equipment', 'Agriculture']; -const ProductCard = ({ product }) => ( -
- {product.name} -
-

{product.name}

-

{product.description}

-
- ${product.price}/day - -
-
- - {product.rating} +const ProductCard = ({ product }) => { + const navigate = useNavigate(); + + const handleRentNowClick = () => { + navigate(`/RentProductDetails/${product._id}`); // Assuming product.id uniquely identifies the product + }; + + return ( +
+ {product.name} +
+

{product.name}

+

{product.description}

+
+ ${product.price}/day + +
+
+ + {product.rating} +
-
-); + ); +}; const FilterSidebar = ({ selectedCategory, setSelectedCategory, priceRange, setPriceRange }) => (
@@ -82,11 +94,14 @@ const RentalMarketplace = () => { const [filteredProducts, setFilteredProducts] = useState([]); const [selectedCategory, setSelectedCategory] = useState('All'); const [priceRange, setPriceRange] = useState({ min: 0, max: 100 }); + const ApiUrl = process.env.NODE_ENV === 'production' + ? 'https://agrotech-ai-11j3.onrender.com' + : 'http://localhost:8080'; useEffect(() => { const fetchProducts = async () => { try { - const response = await fetch(`https://agrotech-ai-11j3.onrender.com/api/rent-products`); + const response = await fetch(`${ApiUrl}/api/rent-products`); const data = await response.json(); setProducts(data); setFilteredProducts(data); // Initialize filteredProducts diff --git a/frontend/src/AgroRentAI/RentAdminDashboard.jsx b/frontend/src/AgroRentAI/RentAdminDashboard.jsx new file mode 100644 index 00000000..bb789441 --- /dev/null +++ b/frontend/src/AgroRentAI/RentAdminDashboard.jsx @@ -0,0 +1,173 @@ +import React, { useState, useEffect } from 'react'; +import { Plus, Edit, Trash, BarChart, Bell } from 'lucide-react'; + +const RentAdminDashboard = () => { + const [products, setProducts] = useState([]); + const [orders, setOrders] = useState([]); + const [users, setUsers] = useState([]); + const [analytics, setAnalytics] = useState({ + popularProducts: [], + revenue: '$0', + rentalFrequency: [], + userBehavior: [], + }); + + // Fetch data + useEffect(() => { + const fetchData = async () => { + const productData = await fetchProducts(); + const orderData = await fetchOrders(); + const userData = await fetchUsers(); + const analyticsData = await fetchAnalytics(); + + setProducts(productData); + setOrders(orderData); + setUsers(userData); + setAnalytics(analyticsData); + }; + + fetchData(); + }, []); + + // Mock API calls + const fetchProducts = async () => { + return [ + { id: 1, name: 'Tractor', price: '$300', category: 'Heavy Machinery', availability: 'In Stock' }, + { id: 2, name: 'Lawn Mower', price: '$100', category: 'Gardening', availability: 'In Stock' }, + ]; + }; + + const fetchOrders = async () => { + return [ + { id: 1, item: 'Tractor', user: 'John Doe', status: 'Pending Approval', returnDate: '2024-12-01' }, + { id: 2, item: 'Lawn Mower', user: 'Jane Smith', status: 'Active', returnDate: '2024-11-15' }, + ]; + }; + + const fetchUsers = async () => { + return [ + { id: 1, name: 'John Doe', email: 'john@example.com', feedback: 'Excellent service!' }, + { id: 2, name: 'Jane Smith', email: 'jane@example.com', feedback: 'Very helpful!' }, + ]; + }; + + const fetchAnalytics = async () => { + return { + popularProducts: ['Tractor', 'Lawn Mower'], + revenue: '$1200', + rentalFrequency: ['Daily', 'Weekly'], + userBehavior: ['Frequently rented Tractor and Plow'], + }; + }; + + const handleAddProduct = () => { + // Add product logic + }; + + const handleUpdateProduct = (id) => { + // Update product logic + }; + + const handleDeleteProduct = (id) => { + setProducts(products.filter((product) => product.id !== id)); + }; + + const handleOrderApproval = (id) => { + setOrders(orders.map((order) => (order.id === id ? { ...order, status: 'Approved' } : order))); + }; + + const handleSendNotification = () => { + // Send notification logic + }; + + return ( +
+

Admin Dashboard

+ + {/* Product Management Section */} +
+

Product Management

+ +
+ {products.map((product) => ( +
+
+

{product.name}

+

{product.price} - {product.category} - {product.availability}

+
+
+ + +
+
+ ))} +
+
+ + {/* Order Management Section */} +
+

Order Management

+
+ {orders.map((order) => ( +
+
+

{order.item}

+

User: {order.user} - Status: {order.status} - Return Date: {order.returnDate}

+
+ +
+ ))} +
+
+ + {/* User Management Section */} +
+

User Management

+
+ {users.map((user) => ( +
+
+

{user.name}

+

Email: {user.email}

+

Feedback: {user.feedback}

+
+
+ ))} +
+
+ + {/* Analytics & Reporting Section */} +
+

Analytics & Reporting

+
+

Revenue: {analytics.revenue}

+

Popular Products: {analytics.popularProducts.join(', ')}

+

Rental Frequency: {analytics.rentalFrequency.join(', ')}

+

User Behavior: {analytics.userBehavior.join(', ')}

+ +
+
+ + {/* Notifications Section */} +
+

Notifications

+

Send reminders and alerts to users.

+ +
+
+ ); +}; + +export default RentAdminDashboard; diff --git a/frontend/src/AgroRentAI/RentProductDetails.jsx b/frontend/src/AgroRentAI/RentProductDetails.jsx new file mode 100644 index 00000000..64175850 --- /dev/null +++ b/frontend/src/AgroRentAI/RentProductDetails.jsx @@ -0,0 +1,111 @@ +import React, { useState, useEffect } from 'react'; +import { Star } from 'lucide-react'; +import { useParams } from 'react-router-dom'; + +const RentProductDetails = () => { + const [product, setProduct] = useState(null); + const [quantity, setQuantity] = useState(1); + const ApiUrl = process.env.NODE_ENV === 'production' + ? 'https://agrotech-ai-11j3.onrender.com' + : 'http://localhost:8080'; + + const {productId} = useParams() + // Fetch product details by product ID + useEffect(() => { + const fetchProductDetails = async () => { + + const response = await fetch(`${ApiUrl}/api/rent-products/${productId}`); + const data = await response.json(); + setProduct(data); + }; + + fetchProductDetails(); + }, [productId]); + + const handleAddToCart = () => { + // Implement the add-to-cart functionality here + console.log(`Added ${quantity} of ${product.name} to cart`); + }; + + const handleProceedToCheckout = () => { + // Redirect to checkout page or handle checkout logic + console.log('Proceeding to checkout'); + }; + + if (!product) { + return

Loading...

; + } + + return ( +
+ {/* Heading */} +

Product Details

+ +
+
+ {/* Product Image */} +
+ {product.name} +
+ + {/* Product Details */} +
+

{product.name}

+
+ + {product.rating} / 5 +
+

{product.description}

+ + {/* Category */} +
+ {product.category.map((cat, index) => ( + + {cat} + + ))} +
+ + {/* Price */} +

${product.price} / day

+ + {/* Quantity Selector */} +
+ + setQuantity(Math.max(1, e.target.value))} + className="w-16 text-center border border-green-300 rounded-md" + /> +
+ + {/* Add to Cart and Checkout Buttons */} +
+ + +
+
+
+
+
+ + + ); +}; + +export default RentProductDetails; diff --git a/frontend/src/AgroShopAI/components/ShopFooter.jsx b/frontend/src/AgroShopAI/components/ShopFooter.jsx index 4d0ad55d..3566b137 100644 --- a/frontend/src/AgroShopAI/components/ShopFooter.jsx +++ b/frontend/src/AgroShopAI/components/ShopFooter.jsx @@ -132,7 +132,7 @@ const ShopFooter = () => {
  • - + FAQ
  • diff --git a/frontend/src/AgroShopAI/pages/Faq.jsx b/frontend/src/AgroShopAI/pages/Faq.jsx new file mode 100644 index 00000000..b33b3fa5 --- /dev/null +++ b/frontend/src/AgroShopAI/pages/Faq.jsx @@ -0,0 +1,123 @@ +import React, { useState } from "react"; +import { BiChevronUp } from 'react-icons/bi'; + +const FAQ = () => { + const [activeIndex, setActiveIndex] = useState(null); + const [faqCount, setFaqCount] = useState(5); // Show 5 FAQs initially + + const faqs = [ + { + "question": "What types of products does AgroShop offer?", + "answer": "AgroShop offers a wide range of products to meet all agricultural needs, including seeds, fertilizers, pesticides, soil health kits, farming tools, machinery, and crop disease prediction tools." + }, + { + "question": "How can I track my order?", + "answer": "Once your order is confirmed, we’ll send a tracking link to your email or SMS. You can also log in to your AgroShop account and go to 'My Orders' to view the current status of your order." + }, + { + "question": "Do you offer bulk discounts?", + "answer": "Yes, we offer bulk discounts on selected products. Contact our customer support team or check the product page for information on available bulk pricing options." + }, + { + "question": "How do I return a product?", + "answer": "If you’re not satisfied with your purchase, you can initiate a return within 7 days of receiving your order. Go to 'My Orders', select the item you wish to return, and follow the return instructions provided." + }, + { + "question": "Can I get expert advice on which products to buy?", + "answer": "Yes! AgroShop provides access to expert recommendations for farmers. Our team can help you select the right products for your specific crops, soil type, and climate." + }, + { + "question": "What payment options are available?", + "answer": "We accept multiple payment methods including credit/debit cards, net banking, UPI, and popular mobile wallets for a seamless checkout experience." + }, + { + "question": "Do you deliver to rural areas?", + "answer": "Yes, AgroShop is committed to serving farmers across urban and rural areas. We deliver nationwide, ensuring that farmers everywhere have access to quality agricultural products." + }, + { + "question": "Are the products on AgroShop certified?", + "answer": "Yes, we only offer products from certified suppliers to ensure quality and reliability. Each product listing includes certification details for your reference." + }, + { + "question": "Can I cancel my order?", + "answer": "You can cancel your order before it is shipped by going to 'My Orders' and selecting the cancel option. Once shipped, cancellation may not be available." + }, + { + "question": "How does AgroShop handle product quality issues?", + "answer": "If you encounter any quality issues with your purchase, please reach out to our support team. We will assist you with a return or exchange based on the situation." + }, + { + "question": "Does AgroShop offer any loyalty or reward program?", + "answer": "Yes, AgroShop has a loyalty program where you earn points on every purchase. These points can be redeemed for discounts on future orders." + }, + { + "question": "Can I set up a subscription for recurring products like fertilizers?", + "answer": "Yes, we offer a subscription service for products you need regularly, such as fertilizers and seeds. Choose the subscription option on the product page to set your delivery frequency." + }, + { + "question": "How can I contact customer support?", + "answer": "You can reach our customer support team via phone, email, or live chat on our website. Our team is available to assist you Monday to Saturday from 9 AM to 6 PM." + } + ] + + const handleToggle = (index) => { + setActiveIndex(activeIndex === index ? null : index); + }; + + const loadMoreFAQs = () => { + setFaqCount(prevCount => Math.min(prevCount + 3, faqs.length)); // Load 3 more FAQs but not exceed total FAQs + }; + + return ( +
    + +
    +
    +

    + Frequently Asked Questions +

    +
    + {faqs.slice(0, faqCount).map((faq, index) => ( +
    +
    + +
    +
    +
    + {faq.answer} +
    +
    +
    + ))} +
    + {faqCount < faqs.length && ( +
    + +
    + )} +
    +
    +
    + + ); +}; + +export default FAQ; diff --git a/frontend/src/MainContent.jsx b/frontend/src/MainContent.jsx index b6568703..89d823a3 100644 --- a/frontend/src/MainContent.jsx +++ b/frontend/src/MainContent.jsx @@ -46,6 +46,11 @@ import ElectricalElectronicsShops from './components/ElectricalElectronicsShops' import HeroSectionRent from './AgroRentAI/HeroSectionRent'; import NavigateProducts from './AgroRentAI/NavigateProducts'; import RentUserDashboard from './AgroRentAI/RentUserDashboard'; + +import RentProductDetails from './AgroRentAI/RentProductDetails'; + +import RentAdminDashboard from './AgroRentAI/RentAdminDashboard'; + //AgroShopAI import HomeShop from './AgroShopAI/pages/HomeShop'; import ShopFooter from './AgroShopAI/components/ShopFooter'; @@ -63,8 +68,11 @@ import TermsOfUse from './AgroShopAI/pages/FooterPages/TermsOfUse'; import ShopPrivacyPolicy from './AgroShopAI/pages/FooterPages/Privacy'; import ForgotPasswordPage from './components/ForgotPassword'; import AccountVerificationPage from './components/EmailVerification'; + +import FAQ from './AgroShopAI/pages/Faq'; import GeminiChat from './components/tools/GeminiChat'; + const MainContent = () => { UseScrollToTop(); const location = useLocation(); // Get the current route @@ -142,7 +150,11 @@ const MainContent = () => { } /> } /> } /> - } /> + + } /> + + } /> + } /> {/* AgroShopAI Routes */} } /> @@ -153,9 +165,10 @@ const MainContent = () => { } /> } /> {/* Footer Links */} - } /> + } />~ } /> } /> + } /> {checkShop ? :