"use client" import { useEffect, useRef, useState } from "react" import { RiArrowRightLine, RiCloseLine, RiMenu3Line } from "@remixicon/react" import { Dialog as DialogPrimitive } from "radix-ui" import { Brand } from "@/components/shared/brand" import { Dialog, DialogClose, DialogDescription, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from "@/components/ui/dialog" type NavigationItem = { label: string href: string description: string } export function MobileNavigation({ items }: { items: NavigationItem[] }) { const [open, setOpen] = useState(false) const navigating = useRef(false) useEffect(() => { const desktop = window.matchMedia("(min-width: 768px)") const closeOnDesktop = () => { if (desktop.matches) setOpen(false) } desktop.addEventListener("change", closeOnDesktop) return () => desktop.removeEventListener("change", closeOnDesktop) }, []) return ( { // Let the anchor move focus to its section without the trigger // interrupting the page's smooth scroll when the dialog closes. if (navigating.current) event.preventDefault() navigating.current = false }} >
Explore Vertex Explore our products, models, features, pricing, and developer documentation.

One API. Every AI model.

{ navigating.current = true }} className="flex h-12 items-center justify-between rounded-lg bg-blue-600 px-4 text-sm font-medium text-white shadow-[0_6px_24px_rgba(23,61,166,.2)] transition-colors hover:bg-blue-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background" > Get started
) }