"use client"; import { HeaderContacts } from "@/components/layout/HeaderContacts"; import { HeaderTools } from "@/components/layout/HeaderTools"; import { LocaleSwitcher } from "@/components/layout/LocaleSwitcher"; import { Logo } from "@/components/layout/Logo"; import { Button } from "@/components/ui/Button"; import { Link } from "@/i18n/routing"; import { cn } from "@/lib/utils"; import { useTranslations } from "next-intl"; import { useEffect, useId, useState } from "react"; const links = [ { href: "/services" as const, key: "services" }, { href: "/doctors" as const, key: "doctors" }, { href: "/booking" as const, key: "booking" }, { href: "/promotions" as const, key: "promotions" }, { href: "/branches" as const, key: "branches" }, { href: "/news" as const, key: "news" }, { href: "/gallery" as const, key: "gallery" }, ]; export function Header() { const t = useTranslations("nav"); const a11y = useTranslations("a11y"); const meta = useTranslations("meta"); const [open, setOpen] = useState(false); const menuId = useId(); useEffect(() => { if (!open) return; function onKey(event: KeyboardEvent) { if (event.key === "Escape") setOpen(false); } document.addEventListener("keydown", onKey); return () => document.removeEventListener("keydown", onKey); }, [open]); return (
{open ? (
) : null}
); }