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/AgroShopAI/components/ShopFooter.jsx b/frontend/src/AgroShopAI/components/ShopFooter.jsx index b670cfd5..143a0a73 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 c8788421..3312ecd5 100644 --- a/frontend/src/MainContent.jsx +++ b/frontend/src/MainContent.jsx @@ -46,7 +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 +67,11 @@ import CancelAndReturnPolicy from './AgroShopAI/pages/FooterPages/CancelAndRetur import TermsOfUse from './AgroShopAI/pages/FooterPages/TermsOfUse'; 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,8 +149,11 @@ const MainContent = () => { } /> } /> } /> - } /> + } /> + + } /> + } /> {/* AgroShopAI Routes */} } /> @@ -154,8 +164,9 @@ const MainContent = () => { } /> } /> {/* Footer Links */} - } /> + } />~ } /> + } /> {checkShop ? :