"use client"; import Link from "next/link"; import Image from "next/image"; import { useTranslations } from "next-intl"; import { usePathname } from "next/navigation"; import { LanguageSwitcher } from "./LanguageSwitcher"; import { Menu, X } from "lucide-react"; import { useState, useEffect } from "react"; export function Header({ locale }: { locale: string }) { const t = useTranslations("navigation"); const pathname = usePathname(); const [mobileMenuOpen, setMobileMenuOpen] = useState(false); const [scrolled, setScrolled] = useState(false); const isHome = pathname === `/${locale}` || pathname === `/${locale}/`; const showSolid = !isHome || scrolled; useEffect(() => { const handleScroll = () => { setScrolled(window.scrollY > 20); }; handleScroll(); window.addEventListener("scroll", handleScroll); return () => window.removeEventListener("scroll", handleScroll); }, []); const navLinks = [ { href: `/${locale}`, label: t("home") }, { href: `/${locale}/houses`, label: t("houses") }, { href: `/${locale}/contact`, label: t("contact") }, ]; return (
BB-Apartment
BB-Apartment
{t("bookNow")}
{mobileMenuOpen && (
)}
); }