import React, { useState, useMemo, useEffect } from 'react'; import { Search, ShoppingCart, User, PlusCircle, MessageSquare, TrendingUp, MapPin, Filter, ChevronRight, Star, Home, Store, Users, Bell, Menu, MoreVertical, CheckCircle, ArrowLeft, Image as ImageIcon, Wifi, Battery, Signal } from 'lucide-react'; const MOCK_PRODUCTS = [ { id: 1, name: "Premium Basmati", seller: "GreenValley Farms", price: 4500, unit: "Quintal", location: "Punjab", moisture: "12%", stock: "500T", rating: 4.8, image: "https://images.unsplash.com/photo-1536633104100-349f9976378e?auto=format&fit=crop&q=80&w=400", category: "Basmati" }, { id: 2, name: "Sona Masuri", seller: "Krishna Mills", price: 3200, unit: "Quintal", location: "Andhra Pradesh", moisture: "14%", stock: "1200T", rating: 4.5, image: "https://images.unsplash.com/photo-1586201375761-83865001e31c?auto=format&fit=crop&q=80&w=400", category: "Non-Basmati" }, { id: 3, name: "Jasmine Fragrant", seller: "Thai Delta", price: 5800, unit: "Quintal", location: "Bangkok", moisture: "11%", stock: "200T", rating: 4.9, image: "https://images.unsplash.com/photo-1590080876351-941da3576dee?auto=format&fit=crop&q=80&w=400", category: "Aromatic" }, { id: 4, name: "IR64 Long Grain", seller: "Global Grains", price: 2800, unit: "Quintal", location: "West Bengal", moisture: "13.5%", stock: "5000T", rating: 4.2, image: "https://images.unsplash.com/photo-1511933048017-06c140883d6a?auto=format&fit=crop&q=80&w=400", category: "Non-Basmati" } ]; const COMMUNITY_POSTS = [ { id: 1, author: "Dr. Ramesh Kumar", role: "Agronomist", content: "Basmati prices expected to rise 5% next month due to lower monsoon yield. Sellers hold inventory.", likes: 124, comments: 18, time: "2h ago", avatar: "https://i.pravatar.cc/150?u=ramesh" }, { id: 2, author: "Kisan Network", role: "Farmer Collective", content: "Successfully harvested Sona Masuri. Yield is better than expected! Looking for bulk buyers.", likes: 245, comments: 42, time: "1d ago", avatar: "https://i.pravatar.cc/150?u=kisan" } ]; export default function App() { const [view, setView] = useState('home'); const [cart, setCart] = useState([]); const [searchQuery, setSearchQuery] = useState(""); const [activeCategory, setActiveCategory] = useState("All"); const [toast, setToast] = useState(null); const [currentTime, setCurrentTime] = useState("12:00"); useEffect(() => { const updateTime = () => { const now = new Date(); setCurrentTime(`${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}`); }; updateTime(); const interval = setInterval(updateTime, 60000); return () => clearInterval(interval); }, []); const showToast = (msg) => { setToast(msg); setTimeout(() => setToast(null), 3000); }; const addToCart = (product) => { setCart(prev => [...prev, { ...product, cartId: Date.now() }]); showToast("Added to cart"); }; const totalAmount = cart.reduce((sum, item) => sum + item.price, 0); const StatusBar = () => (
Avg Price
₹3,450/q
Active Buyers
1.2k+
₹{product.price}/q
{product.stock} available
₹{product.price}
Add Photos
{post.role} • {post.time}
{post.content}
Browse the marketplace to find the best paddy deals.
{item.seller}
₹{item.price}