"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { Home, Building, Calendar, CreditCard, Briefcase, BookOpen } 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: Building }, ...(isOwnerOrAgent ? [ { href: "/owner/properties", label: t("myProperties"), icon: Briefcase }, { href: "/owner/bookings", label: "عقاراتي المحجوزة", icon: Briefcase }, { href: "/reservations", label: "حجوزاتي", icon: Calendar }, ] : [{ href: "/booked-properties", label: "حجوزاتي", icon: Briefcase }]), { href: bookingsHref, label: "طلبات الحجز", icon: Calendar }, { href: "/payments", label: t("payments"), icon: CreditCard }, ...(isOwnerOrAgent ? [{ href: "/owner/account-book", label: t("accountBook"), icon: BookOpen }] : []), ]; const isActive = (href) => { if (href === "/") return pathname === "/"; return pathname.startsWith(href); }; return (
); }