()
| 41 | } |
| 42 | |
| 43 | function PageNavigation() { |
| 44 | let pathname = usePathname() |
| 45 | let allPages = navigation.flatMap((group) => group.links) |
| 46 | let currentPageIndex = allPages.findIndex((page) => page.href === pathname) |
| 47 | |
| 48 | if (currentPageIndex === -1) { |
| 49 | return null |
| 50 | } |
| 51 | |
| 52 | let previousPage = allPages[currentPageIndex - 1] |
| 53 | let nextPage = allPages[currentPageIndex + 1] |
| 54 | |
| 55 | if (!previousPage && !nextPage) { |
| 56 | return null |
| 57 | } |
| 58 | |
| 59 | return ( |
| 60 | <div className="flex"> |
| 61 | {previousPage && ( |
| 62 | <div className="flex flex-col items-start gap-3"> |
| 63 | <PageLink label="Previous" page={previousPage} previous /> |
| 64 | </div> |
| 65 | )} |
| 66 | {nextPage && ( |
| 67 | <div className="ml-auto flex flex-col items-end gap-3"> |
| 68 | <PageLink label="Next" page={nextPage} /> |
| 69 | </div> |
| 70 | )} |
| 71 | </div> |
| 72 | ) |
| 73 | } |
| 74 | |
| 75 | function SocialLink({ |
| 76 | href, |
nothing calls this directly
no outgoing calls
no test coverage detected