diff --git a/app/components/BottomNav.js b/app/components/BottomNav.js index c72e92a..e0a61ff 100644 --- a/app/components/BottomNav.js +++ b/app/components/BottomNav.js @@ -1,11 +1,13 @@ "use client"; import Link from "next/link"; +import { usePathname } from "next/navigation"; import { Home, Building, Calendar, Heart, Bell, Settings, CreditCard, Briefcase } from "lucide-react"; import React, { useEffect, useState } from "react"; import { useNotifications } from "@/app/contexts/NotificationsContext"; export default function BottomNav({ isOwner, isOwnerOrAgent }) { + const pathname = usePathname(); const { unreadCount } = useNotifications(); const [isMounted, setIsMounted] = useState(false); const bookingsHref = isOwner ? "/owner/reservations" : "/reservations"; @@ -25,16 +27,22 @@ export default function BottomNav({ isOwner, isOwnerOrAgent }) { { href: "/settings", label: "الإعدادات", icon: Settings }, ]; + const isActive = (href) => { + if (href === "/") return pathname === "/"; + return pathname.startsWith(href); + }; + return (