'use client'; import { Home, Phone, Ticket, User } from 'lucide-react'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { useAuthStore } from '@/lib/auth-store'; // The linear, one-screen-at-a-time booking flow — each of these pages already // has its own sticky mobile CTA bar (and the mobile step strip at the top), // so the tab bar hides rather than stacking a second bottom bar underneath. const LINEAR_FLOW_PREFIXES = [ '/booking/search', '/booking/results', '/booking/seats', '/booking/passengers', '/booking/auth-check', '/booking/review', '/booking/payment', '/booking/confirmation', ]; export default function BottomTabBar() { const pathname = usePathname() ?? ''; const isAuthenticated = useAuthStore((s) => s.isAuthenticated); const isInLinearFlow = LINEAR_FLOW_PREFIXES.some((p) => pathname.startsWith(p)); if (isInLinearFlow) return null; const tabs = [ { href: '/', label: 'Home', icon: Home, match: (p: string) => p === '/' }, { href: '/booking/lookup', label: 'Bookings', icon: Ticket, match: (p: string) => p.startsWith('/booking/lookup') || p.startsWith('/booking/detail') }, { href: '/contact', label: 'Contact', icon: Phone, match: (p: string) => p.startsWith('/contact') }, { href: isAuthenticated ? '/profile' : '/login', label: isAuthenticated ? 'Account' : 'Sign in', icon: User, match: (p: string) => p.startsWith('/profile') || p.startsWith('/login') || p.startsWith('/register'), }, ]; return ( <> {/* In-flow spacer so page content/Footer can't end up hidden behind the fixed bar below — self-contained here so it only exists when the bar itself is actually rendered. */}