var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PrevNextButtons=void 0;var _react=_interopRequireDefault(require("react"));var _primitives=require("../../primitives");var _helperFunction=require("../../utils/helperFunction");var _LayoutContext=require("../Layout/LayoutContext");var _LinkButton=require("./LinkButton");var _jsxRuntime=require("react/jsx-runtime");var PrevNextButtons=function PrevNextButtons(_ref){var sidebarItems=_ref.sidebarItems;var _React$useContext=_react.default.useContext(_LayoutContext.LayoutContext),router=_React$useContext.router,Link=_React$useContext.Link;var _getPrevAndNextLinks=(0,_helperFunction.getPrevAndNextLinks)((0,_helperFunction.convertSidebarItemsToPathsArray)(sidebarItems),router.pathname),prev=_getPrevAndNextLinks.prev,next=_getPrevAndNextLinks.next,prevLink=_getPrevAndNextLinks.prevLink,nextLink=_getPrevAndNextLinks.nextLink;return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_primitives.VStack,{reversed:true,width:'$full',space:'md',sx:{'@md':{display:'none'}},justifyContent:"space-between",mt:'$10',mb:'$20',children:[prevLink?(0,_jsxRuntime.jsx)(_LinkButton.LinkButton,{pageText:prev,pageLink:prevLink,NextLink:Link,type:'previous'}):null,nextLink?(0,_jsxRuntime.jsx)(_LinkButton.LinkButton,{pageText:next,pageLink:nextLink,NextLink:Link,type:'next'}):null]}),(0,_jsxRuntime.jsxs)(_primitives.HStack,{width:"$full",space:'md',sx:{'@base':{display:'none'},'@md':{display:'flex'}},justifyContent:"space-between",mt:'$10',mb:'$20',children:[prevLink?(0,_jsxRuntime.jsx)(_LinkButton.LinkButton,{pageText:prev,pageLink:prevLink,NextLink:Link,type:'previous'}):(0,_jsxRuntime.jsx)(_primitives.Box,{flex:1}),nextLink?(0,_jsxRuntime.jsx)(_LinkButton.LinkButton,{pageText:next,pageLink:nextLink,NextLink:Link,type:'next'}):(0,_jsxRuntime.jsx)(_primitives.Box,{flex:1})]})]});};exports.PrevNextButtons=PrevNextButtons;
//# sourceMappingURL=index.js.map