var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ComponentIntro=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _objectDestructuringEmpty2=_interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));var _react=_interopRequireDefault(require("react"));var _primitives=require("../../primitives");var _helperFunction=require("../../utils/helperFunction");var _H=require("../H1");var _LayoutContext=require("../Layout/LayoutContext");var _styledComponents=require("../../styled-components");var _jsxRuntime=require("react/jsx-runtime");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){(0,_defineProperty2.default)(target,key,source[key]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}return target;}var ComponentIntro=function ComponentIntro(_ref){var _result$metaData,_result$metaData2,_result$metaData3,_result$metaData$page,_result$metaData4,_result$metaData5,_result$metaData6,_result$metaData7,_result$metaData8,_result$metaData9,_result$metaData10,_result$metaData$page2,_result$metaData11,_result$metaData12;var props=Object.assign({},((0,_objectDestructuringEmpty2.default)(_ref),_ref));var _React$useContext=_react.default.useContext(_LayoutContext.LayoutContext),isOpenSidebar=_React$useContext.isOpenSidebar,sidebarItems=_React$useContext.sidebarItems,router=_React$useContext.router;var result=(0,_helperFunction.findPageById)(router.pathname,sidebarItems);return result!=null&&(_result$metaData=result.metaData)!=null&&_result$metaData.showHeader?(0,_jsxRuntime.jsxs)(_primitives.Box,_objectSpread(_objectSpread({},props),{},{bg:"$borderLight50",alignItems:"center",w:"100%",flexDirection:"row",px:'$4',sx:{_dark:{bg:'$backgroundDark900'}},children:[(0,_jsxRuntime.jsx)(_primitives.Box,{flex:1,maxWidth:736,mx:'auto',display:isOpenSidebar?'none':'flex',children:(0,_jsxRuntime.jsxs)(_primitives.Box,{children:[result!=null&&(_result$metaData2=result.metaData)!=null&&_result$metaData2.pageTitle||result!=null&&(_result$metaData3=result.metaData)!=null&&_result$metaData3.title?(0,_jsxRuntime.jsxs)(_primitives.Box,{flexDirection:"row",children:[(0,_jsxRuntime.jsx)(_H.H1,{mt:'$4',mb:'$2',color:"$textLight900",sx:{_dark:{color:'$textDark50'}},children:(_result$metaData$page=result==null?void 0:(_result$metaData4=result.metaData)==null?void 0:_result$metaData4.pageTitle)!=null?_result$metaData$page:result==null?void 0:(_result$metaData5=result.metaData)==null?void 0:_result$metaData5.title}),(0,_jsxRuntime.jsx)(_primitives.Box,{justifyContent:"center",ml:"$0.5",children:(result==null?void 0:(_result$metaData6=result.metaData)==null?void 0:_result$metaData6.tag)&&(0,_jsxRuntime.jsx)(_styledComponents.StyledSideBarTag,{mt:"$7",mb:"$2",px:"$2",variant:result==null?void 0:(_result$metaData7=result.metaData)==null?void 0:_result$metaData7.tag,sx:{bg:'$backgroundLight200',_dark:{bg:'$backgroundDark950'}},children:(0,_jsxRuntime.jsx)(_styledComponents.StyledSideBarTagText,{fontSize:14,children:result==null?void 0:(_result$metaData8=result.metaData)==null?void 0:_result$metaData8.tag})})})]}):null,result!=null&&(_result$metaData9=result.metaData)!=null&&_result$metaData9.pageDescription||result!=null&&(_result$metaData10=result.metaData)!=null&&_result$metaData10.description?(0,_jsxRuntime.jsx)(_primitives.Text,{mb:'$4',fontWeight:'$normal',lineHeight:'$md',fontSize:'$md',color:"$textLight700",sx:{_dark:{color:'$textDark300'}},children:(_result$metaData$page2=result==null?void 0:(_result$metaData11=result.metaData)==null?void 0:_result$metaData11.pageDescription)!=null?_result$metaData$page2:result==null?void 0:(_result$metaData12=result.metaData)==null?void 0:_result$metaData12.description}):null]})}),(0,_jsxRuntime.jsx)(_primitives.Box,{width:200,sx:{'display':'none','@xl':{display:'flex'}}})]})):null;};exports.ComponentIntro=ComponentIntro;
//# sourceMappingURL=index.js.map