import Link from 'next/link' import { useRouter } from 'next/router' import clsx from 'clsx' import { AnimatePresence, motion, useIsPresent } from 'framer-motion' import { Button } from '@/components/Button' import { Tag } from '@/components/Tag' import { remToPx } from '@/lib/remToPx' import {useIsInsideMobileNavigation} from "@/components/MobileNavigation"; export const apiNavigation = [ { title: 'Guides', links: [ { title: 'Quickstart', href: '/ipa/guides/quickstart' }, { title: 'Authentication', href: '/ipa/guides/authentication' }, { title: 'Errors', href: '/ipa/guides/errors' }, // { title: 'Events', href: '/accounts' }, ], }, { title: 'Resources', links: [ { title: 'Accounts', href: '/ipa/resources/accounts' }, { title: 'Users', href: '/ipa/resources/users' }, { title: 'Tokens', href: '/ipa/resources/tokens' }, { title: 'Peers', href: '/ipa/resources/peers' }, { title: 'Setup Keys', href: '/ipa/resources/setup-keys' }, { title: 'Groups', href: '/ipa/resources/groups' }, { title: 'Rules', href: '/ipa/resources/rules' }, { title: 'Policies', href: '/ipa/resources/policies' }, { title: 'Routes', href: '/ipa/resources/routes' }, { title: 'DNS', href: '/ipa/resources/dns' }, { title: 'Events', href: '/ipa/resources/events' }, ], }, ] export function NavigationAPI({tableOfContents, className}) { return ( ) } export function TopLevelNavItem({ href, children }) { return (
  • {children}
  • ) } export function NavLink({ href, tag, active, isAnchorLink = false, children }) { return ( {children} {tag && ( {tag} )} ) } export function VisibleSectionHighlight({ group, pathname }) { let height = remToPx(2) let offset = remToPx(0) let activePageIndex = group.links.findIndex((link) => link.href === pathname) let top = offset + activePageIndex * height return ( ) } export function ActivePageMarker({ group, pathname }) { let itemHeight = remToPx(2) let offset = remToPx(0.25) let activePageIndex = group.links.findIndex((link) => link.href === pathname) let top = offset + activePageIndex * itemHeight return ( ) } function NavigationGroup({ group, className, tableOfContents }) { let router = useRouter() let isActiveGroup = group.links.findIndex((link) => link.href === router.pathname) !== -1 return (
  • {group.title}
    {isActiveGroup && ( )} {isActiveGroup && ( )}
      {group.links.map((link) => ( {link.title} {link.href === router.pathname && ( {router.route.startsWith("/ipa/resources") && tableOfContents?.map((section) => (
    • {section.title}
    • ))}
      )}
      ))}
  • ) }