"use client"; import type { ComponentType } from "react"; import { CalendarDays, CircleUserRound, Home, Newspaper } from "lucide-react"; import { usePathname } from "next/navigation"; import { useAuth } from "@/contexts/AuthContext"; import { Link } from "@/lib/router"; import { cn } from "@/lib/utils"; import type { SiteContent } from "@/lib/content-cms"; type NavItem = { key: string; label: string; href: string; icon: ComponentType<{ className?: string }>; matches: (pathname: string) => boolean; }; const isProfileOrAuthPath = (pathname: string) => pathname === "/profile" || pathname.startsWith("/profile/") || pathname === "/auth" || pathname.startsWith("/auth/") || pathname.startsWith("/reset-password"); export default function MobileBottomNav({ siteContent }: { siteContent: SiteContent }) { const pathname = usePathname() || "/"; const { isAuthenticated } = useAuth(); if (pathname.startsWith("/admin") || pathname === "/logout" || pathname.startsWith("/auth/google")) { return null; } const items: NavItem[] = [ { key: "home", label: siteContent.navigation.home, href: "/", icon: Home, matches: (current) => current === "/", }, { key: "events", label: siteContent.navigation.events, href: "/events", icon: CalendarDays, matches: (current) => current === "/events" || current.startsWith("/events/"), }, { key: "blog", label: siteContent.navigation.blog, href: "/blog", icon: Newspaper, matches: (current) => current === "/blog" || current.startsWith("/blog/"), }, { key: "account", label: isAuthenticated ? "پروفایل" : "حساب", href: isAuthenticated ? "/profile" : "/auth", icon: CircleUserRound, matches: isProfileOrAuthPath, }, ]; return (