var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Breadcrumbs=void 0;var _react=_interopRequireDefault(require("react"));var _primitives=require("../../primitives");var _LayoutContext=require("../Layout/LayoutContext");var _jsxRuntime=require("react/jsx-runtime");var Breadcrumbs=function Breadcrumbs(){var _React$useContext=_react.default.useContext(_LayoutContext.LayoutContext),breadcrumbs=_React$useContext.breadcrumbs,Link=_React$useContext.Link;if(breadcrumbs){var breadcrumbLinks=[];breadcrumbs.forEach(function(breadcrumb,index){var href=breadcrumb.id||`/${breadcrumb.title.toLowerCase()}`;breadcrumbLinks.push({href:index===0?href:`${breadcrumbLinks[index-1].href}${href}`,title:breadcrumb.title});});return(0,_jsxRuntime.jsx)(_primitives.Box,{mb:'$2',flexDirection:'row',ml:14,children:breadcrumbs.map(function(breadcrumb,index){return(0,_jsxRuntime.jsxs)(_primitives.Box,{flexDirection:"row",children:[index>0&&(0,_jsxRuntime.jsx)(_primitives.Text,{children:' / '}),breadcrumb.id?(0,_jsxRuntime.jsx)(Link,{href:breadcrumb.id,passHref:true,children:(0,_jsxRuntime.jsx)(_primitives.Text,{color:'$textLight700',sx:{_dark:{color:'$textDark300'}},children:breadcrumb.title})}):(0,_jsxRuntime.jsx)(_primitives.Text,{color:'$textLight900',fontWeight:'$medium',sx:{_dark:{color:'$textDark50'}},children:breadcrumb.title})]},breadcrumb.id||index);})});}else{return null;}};exports.Breadcrumbs=Breadcrumbs;
//# sourceMappingURL=index.js.map