"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { Home, Building2, Building, CalendarCheck, CalendarDays, ClipboardList, CreditCard, BookOpenCheck } from "lucide-react"; import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { label } from "framer-motion/client"; export default function BottomNav({ isOwner, isOwnerOrAgent }) { const { t } = useTranslation(); const pathname = usePathname(); const [isMounted, setIsMounted] = useState(false); const bookingsHref = isOwner ? "/owner/reservations" : "/reservations"; useEffect(() => { setIsMounted(true); }, []); const items = [ { href: "/", label: t("home"), icon: Home }, { href: "/properties", label: t("ourProperties"), icon: Building2 }, ...(isOwnerOrAgent ? [ { href: "/owner/properties", label: t("myProperties"), icon: Building }, { href: "/owner/bookings", label: t("Myseizedproperties"), icon: CalendarCheck }, { href: "/reservations", label: t("Mybookings"), icon: CalendarDays }, ] : [{ href: "/booked-properties", label: t("Mybookings"), icon: CalendarDays }]), { href: bookingsHref, label: t("Orders"), icon: ClipboardList }, { href: "/payments", label: t("payments"), icon: CreditCard }, ...(isOwnerOrAgent ? [{ href: "/owner/account-book", label: t("accountBook"), icon: BookOpenCheck }] : []), ]; const isActive = (href) => { if (href === "/") return pathname === "/"; return pathname.startsWith(href); }; return (