import React from 'react'; import { Box, HStack, VStack } from '../../primitives'; import { convertSidebarItemsToPathsArray, getPrevAndNextLinks, } from '../../utils/helperFunction'; import { LayoutContext } from '../Layout/LayoutContext'; import { LinkButton } from './LinkButton'; export const PrevNextButtons = ({ sidebarItems }: any) => { const { router, Link } = React.useContext(LayoutContext); const { prev, next, prevLink, nextLink } = getPrevAndNextLinks( convertSidebarItemsToPathsArray(sidebarItems), router.pathname ); return ( <> {prevLink ? ( ) : null} {nextLink ? ( ) : null} {prevLink ? ( ) : ( )} {nextLink ? ( ) : ( )} ); };