'use client'; import { Activity, BarChart3, Globe2, MoreHorizontal, Search } from 'lucide-react'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { useEffect, useState } from 'react'; import { cn } from '@/lib/cn'; import { moreNav, primaryNav, routes } from '@/lib/site'; import { useOpenSearch } from './search-context'; /** * Native-feeling bottom tab bar (< md): Explore · Search · Events · Stats · More. Safe-area aware; the body reserves * `pb-[calc(58px+env(safe-area-inset-bottom))]` so it never covers the footer. Hidden on /explore (full-screen globe has its own controls). */ export function MobileTabBar() { const pathname = usePathname(); const openSearch = useOpenSearch(); const [more, setMore] = useState(false); useEffect(() => setMore(false), [pathname]); const tabs = [ { href: routes.explore(), label: 'Explore', Icon: Globe2, match: (p: string) => p === '/' || p.startsWith('/explore') || p.startsWith('/satellite') }, { href: routes.events(), label: 'Events', Icon: Activity, match: (p: string) => p.startsWith('/events') }, { href: routes.stats(), label: 'Stats', Icon: BarChart3, match: (p: string) => p.startsWith('/stats') || p.startsWith('/rankings') }, ]; return ( <> {more && (
Browse