"use client"; import { useState } from "react"; import Link from "next/link"; import { usePathname, useRouter } from "next/navigation"; import { Home, Compass, Plus, User, ChevronDown, Mail, BadgeCheck, } from "lucide-react"; import { useTranslations } from "next-intl"; import { NotificationBell } from "@/components/notifications/NotificationBell"; import { PostTypeSheet } from "@/components/post-creation/PostTypeSheet"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { PetAvatar } from "@/components/ui/pet-avatar"; import { Badge } from "@/components/ui/badge"; import { useActivePet } from "@/context/ActivePetContext"; type Pet = { id: string; name: string; avatarKey: string | null; isVerified: boolean; species: { name: string }; }; type MobileNavProps = { pets: Pet[]; }; /** * Mobile bottom tab bar — visible below lg: breakpoint. * * UI-SPEC: Navigation (App Shell) — Mobile * - Fixed bottom bar (h-16) with bg-card border-top * - 5 tabs: Home, Explore (placeholder), Post (center, orange-500), Notifications (placeholder), Profile * - Top active pet switcher dropdown above the tab bar * * Explore and Notifications are placeholder tabs (aria-disabled) in Phase 1. * Post tab (center) links to /pets in Phase 1 — full post creation in Phase 2. * * Deviation notes: * - shadcn base-nova uses @base-ui/react/menu which does not support asChild on * DropdownMenuTrigger or DropdownMenuItem. Using onClick+useRouter for navigation items. */ export function MobileNav({ pets }: MobileNavProps) { const pathname = usePathname(); const router = useRouter(); const { activePetId, setActivePet } = useActivePet(); const t = useTranslations("Nav"); const activePet = pets.find((p) => p.id === activePetId) ?? pets[0]; const [postTypeSheetOpen, setPostTypeSheetOpen] = useState(false); // First-load fallback is handled once, centrally, by ActivePetInitializer // (mounted alongside Sidebar/MobileNav in the app layout) — don't duplicate it here. // D-05: Home → /feed; also highlight when on / (which redirects to /feed) const isHomePage = pathname === "/feed" || pathname === "/"; const isPetsPage = pathname.startsWith("/pets"); const isExplorePage = pathname.startsWith("/explore"); const isNotificationsPage = pathname.startsWith("/notifications"); const isMessagesPage = pathname.startsWith("/messages"); return (