import React, { Suspense, useCallback, useEffect, useState } from "react"; import { usePageContext } from "vike-react/usePageContext"; import { Dialog, DialogPanel } from "@headlessui/react"; import { Navigation } from "@syntax/Navigation"; import { Link } from "@/components/common/Link"; import { Logo } from "@syntax/Logo"; function MenuIcon(props: React.ComponentPropsWithoutRef<"svg">) { return ( ); } function CloseIcon(props: React.ComponentPropsWithoutRef<"svg">) { return ( ); } function CloseOnNavigation({ close }: { close: () => void }) { const { urlPathname } = usePageContext(); useEffect(() => { close(); }, [urlPathname, close]); return null; } export function MobileNavigation() { const [isOpen, setIsOpen] = useState(false); const close = useCallback(() => setIsOpen(false), [setIsOpen]); function onLinkClick(event: React.MouseEvent) { const link = event.currentTarget; if ( link.pathname + link.search + link.hash === window.location.pathname + window.location.search + window.location.hash ) { close(); } } return ( <> close()} className="fixed inset-0 z-50 flex items-start overflow-y-auto bg-slate-900/50 pr-10 backdrop-blur-sm lg:hidden" aria-label="Navigation" >
); }