mirror of
https://github.com/vercel/flags.git
synced 2026-09-19 03:49:23 +08:00
cf9ccd0076
* Scaffold Geistdocs instance * Update biome.json * Replace content * Re-path docs * Update docs package name * Misc fixes * Update geistdocs.tsx * Move content to correct folder * Start migrating custom components * Finish migrating custom components * Migrate existing redirects * Remove #next suffixes from code blocks * Migrate homepage and flags * Remove duplicate lockfiles * Start fixing homepage * Replace Geist components * Fix colors * Improve layout * Fix code blocks * Fix hero * Fix illustrations * Fix redirect * Fix nav links * Patch in FrameworkSwitcher * Bump Next.js in docs * Delete turbo.json * Misc fixes * More logo fixes
53 lines
1.5 KiB
TypeScript
53 lines
1.5 KiB
TypeScript
"use client";
|
|
|
|
import DynamicLink from "fumadocs-core/dynamic-link";
|
|
import { ExternalLinkIcon } from "lucide-react";
|
|
import {
|
|
NavigationMenu,
|
|
NavigationMenuItem,
|
|
NavigationMenuLink,
|
|
NavigationMenuList,
|
|
} from "@/components/ui/navigation-menu";
|
|
import { useIsMobile } from "@/hooks/use-mobile";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
type DesktopMenuProps = {
|
|
items: { label: string; href: string }[];
|
|
className?: string;
|
|
};
|
|
|
|
export const DesktopMenu = ({ items, className }: DesktopMenuProps) => {
|
|
const isMobile = useIsMobile();
|
|
|
|
return (
|
|
<NavigationMenu viewport={isMobile}>
|
|
<NavigationMenuList className={cn("gap-px", className)}>
|
|
{items.map((item) => (
|
|
<NavigationMenuItem key={item.href}>
|
|
<NavigationMenuLink
|
|
asChild
|
|
className="rounded-md px-3 font-medium text-sm"
|
|
>
|
|
{item.href.startsWith("http") ? (
|
|
<a
|
|
className="flex flex-row items-center gap-2"
|
|
href={item.href}
|
|
rel="noopener"
|
|
target="_blank"
|
|
>
|
|
{item.label}
|
|
<ExternalLinkIcon className="size-3.5" />
|
|
</a>
|
|
) : (
|
|
<DynamicLink href={`/[lang]${item.href}`}>
|
|
{item.label}
|
|
</DynamicLink>
|
|
)}
|
|
</NavigationMenuLink>
|
|
</NavigationMenuItem>
|
|
))}
|
|
</NavigationMenuList>
|
|
</NavigationMenu>
|
|
);
|
|
};
|