"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { Icon } from "@iconify-icon/react"; import type { ReactNode } from "react"; import { Button } from "./Button"; import { navigation } from "./Navigation"; function PageLink({ label, page, previous = false, }: { label: string; page: { href: string; title: string }; previous?: boolean; }) { return ( <> {page.title} > ); } function PageNavigation() { const pathname = usePathname(); const allPages = navigation.flatMap((group) => group.links); const currentPageIndex = allPages.findIndex( (page) => page.href === pathname, ); if (currentPageIndex === -1) { return null; } const previousPage = allPages[currentPageIndex - 1]; const nextPage = allPages[currentPageIndex + 1]; if (!(previousPage || nextPage)) { return null; } return (
© Copyright {new Date().getFullYear()}. Licensed under{" "} CC BY-SA 4.0 .