import { Link, useLocation } from "wouter"; import { useAuth } from "@/hooks/use-auth"; import { useCart } from "@/hooks/use-cart"; import { Home, Search, ShoppingCart, User, Package } from "lucide-react"; export default function MobileBottomNav() { const [location] = useLocation(); const { isAuthenticated, user, userType } = useAuth(); const { itemCount } = useCart(); // Hide navigation on admin pages since they have their own floating nav if (location.startsWith('/admin-prospective')) { return null; } const isActive = (path: string) => { if (path === '/') { return location === '/'; } return location.startsWith(path); }; const navItems = [ { id: 'home', label: 'Home', path: '/', icon: Home, active: isActive('/'), isLink: true }, { id: 'search', label: 'Search', path: '/search', icon: Search, active: isActive('/search'), isLink: true }, ...(isAuthenticated && userType === 'user' ? [{ id: 'orders', label: 'Track Orders', path: '/orders', icon: Package, active: isActive('/orders'), isLink: true }] : []), { id: 'cart', label: 'Cart', path: '/cart', icon: ShoppingCart, active: isActive('/cart'), badge: itemCount > 0 ? itemCount : undefined, isLink: true }, { id: 'profile', label: isAuthenticated ? 'Profile' : 'Sign In', path: isAuthenticated ? '/profile' : '/auth', icon: isAuthenticated ? (userType === 'seller' ? Package : User) : User, active: isActive(isAuthenticated ? '/profile' : '/auth'), isLink: true } ]; return (
{/* Floating Navigation Card */}
); }