TypeScript 50.6%
JavaScript 46.1%
SQL 2.1%
Shell 0.6%
CSS 0.5%
1"use client";2import Link from "next/link";3import { usePathname } from "next/navigation";4import { Logo } from "./logo";5import { IconHeart, IconSearch, IconUser } from "./icons";67const NAV = [8 { href: "/recherche?marche=achat", label: "Acheter", match: /^\/recherche(?!.*marche=location)/ },9 { href: "/recherche?marche=location", label: "Louer", match: /marche=location/ },10 { href: "/estimer", label: "Estimer", match: /^\/estimer/ },11 { href: "/carte", label: "Carte", match: /^\/carte/ },12 { href: "/marche", label: "Marché", match: /^\/marche/ },13 { href: "/financement", label: "Financer", match: /^\/financement/ },14];1516export function SiteHeader() {17 const path = usePathname() ?? "/";18 return (19 <header className="sticky top-0 z-40 bg-white/90 backdrop-blur border-b border-line">20 <div className="mx-auto max-w-7xl px-4 h-14 md:h-16 flex items-center gap-4">21 <Logo />22 <nav className="hidden md:flex items-center gap-1 ml-4" aria-label="Navigation principale">23 {NAV.map((n) => (24 <Link key={n.href} href={n.href} className={`px-3 py-2 rounded-full text-sm font-medium transition ${n.match.test(path) ? "text-brand-dark bg-brand-soft" : "text-ink-2 hover:text-ink hover:bg-surface-2"}`}>{n.label}</Link>25 ))}26 </nav>27 <div className="ml-auto flex items-center gap-2">28 <Link href="/recherche" className="md:hidden p-2 rounded-full hover:bg-surface-2" aria-label="Rechercher"><IconSearch /></Link>29 <Link href="/favoris" className="p-2 rounded-full hover:bg-surface-2 text-ink-2" aria-label="Mes favoris"><IconHeart /></Link>30 <Link href="/membre" className="hidden md:inline-flex p-2 rounded-full hover:bg-surface-2 text-ink-2" aria-label="Mon compte"><IconUser /></Link>31 <Link href="/membre/annonces/nouvelle" className="inline-flex tv-btn tv-btn-primary !py-2 text-sm whitespace-nowrap"><span className="sm:hidden">Publier</span><span className="hidden sm:inline">Publier une propriété</span></Link>32 </div>33 </div>34 </header>35 );36}37