'use client';
import { Fragment, type JSX } from 'react';
import {
ArrowUpRightIcon,
Bars3Icon,
ChevronDownIcon,
XMarkIcon,
} from '@heroicons/react/24/outline';
import { AlgoliaSearch } from '@nx/nx-dev/feature-search';
import cx from 'classnames';
import Link from 'next/link';
import { useRouter } from 'next/router';
import { ButtonLink } from '../button';
import { NxIcon } from '../nx-icon';
import { Popover, Transition } from '@headlessui/react';
import { TwoColumnsMenu } from './two-columns-menu';
import {
featuresItems,
resourceMenuItems,
solutionsMenuItems,
} from './menu-items';
import { SectionsMenu } from './sections-menu';
import { NxCloudIcon } from '../nx-cloud-icon';
import { AnnouncementBanner } from '../announcement-banner';
import { DiscordIcon } from '../discord-icon';
function Menu({ tabs }: { tabs: any[] }): JSX.Element {
return (
);
}
export function DocumentationHeader({
isNavOpen,
toggleNav,
}: {
isNavOpen: boolean;
toggleNav: (value: boolean) => void;
}): JSX.Element {
const router = useRouter();
let routerPath = router.asPath;
const isCI: boolean = routerPath.startsWith('/ci');
const isAPI: boolean = routerPath.startsWith('/nx-api');
const isExtendingNx: boolean = routerPath.startsWith('/extending-nx');
const isPlugins: boolean = routerPath.startsWith('/plugin-registry');
const isChangelog: boolean = routerPath.startsWith('/changelog');
const isAiChat: boolean = router.asPath.startsWith('/ai-chat');
const isNx: boolean =
!isCI &&
!isAPI &&
!isExtendingNx &&
!isPlugins &&
!isChangelog &&
!isAiChat;
const sections = [
{ name: 'Nx', href: '/getting-started/intro', current: isNx },
{
name: 'CI',
href: '/ci/intro/ci-with-nx',
current: isCI,
},
{
name: 'Extending Nx',
href: '/extending-nx/intro/getting-started',
current: isExtendingNx,
},
{
name: 'Plugins',
href: '/plugin-registry',
current: isPlugins,
},
{
name: 'API',
href: '/nx-api',
current: isAPI,
},
{
name: 'Changelog',
href: '/changelog',
current: isChangelog,
},
{
name: 'AI Chat',
href: '/ai-chat',
current: isAiChat,
},
];
const communityLinks = [
{
name: 'Discord',
label: 'Community channel',
href: 'https://go.nx.dev/community',
icon: (props: any) => ,
},
{
name: 'X',
label: 'Latest news',
href: 'https://x.com/NxDevTools?utm_source=nx.dev',
icon: (props: any) => (
),
},
{
name: 'Youtube',
label: 'Youtube channel',
href: 'https://www.youtube.com/@NxDevtools?utm_source=nx.dev',
icon: (props: any) => (
),
},
{
name: 'GitHub',
label: 'Nx is open source, check the code on GitHub',
href: 'https://github.com/nrwl/nx?utm_source=nx.dev',
icon: (props: any) => (
),
},
];
return (
{/*MOBILE MENU*/}
{/*SEARCH*/}
{/*LOGO*/}
Nx
Docs
{/*SEARCH*/}
{/*NAVIGATION*/}
{/* SPACER */}
);
}