Liferay.Loader.define("layout-reports-web@1.0.56/js/components/SidebarHeader",["module","exports","require","@frontend-taglib-clay$clayui/button","liferay!frontend-js-react-web$react","../constants/actionTypes","../context/StoreContext","../utils/loadIssues"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function SidebarHeader(){const{selectedIssue:e}=(0,l.useContext)(o.StoreStateContext);return e?l.default.createElement(IssueDetailSidebarHeader,null):l.default.createElement(DefaultSidebarHeader,null)};var n=a("@frontend-taglib-clay$clayui/button"),l=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var r=n?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(a,l,r):a[l]=e[l]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),r=a("../constants/actionTypes"),o=a("../context/StoreContext"),i=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(a("../utils/loadIssues"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}const DefaultSidebarHeader=()=>{const{data:e,languageId:t,loading:a}=(0,l.useContext)(o.StoreStateContext),r=(0,l.useContext)(o.StoreDispatchContext),s=(null==e?void 0:e.validConnection)&&!(null==e?void 0:e.privateLayout);return l.default.createElement("div",{className:"d-flex justify-content-between p-3 sidebar-header"},l.default.createElement("span",{className:"font-weight-bold"},Liferay.Language.get("page-audit")),l.default.createElement("div",null,s&&l.default.createElement(n.ClayButtonWithIcon,{className:"component-action mr-2 sidenav-relaunch text-secondary",disabled:a,displayType:"unstyled",onClick:()=>{const a=e.pageURLs.find((a=>a.languageId===(t||e.defaultLanguageId)));(0,i.default)({dispatch:r,languageId:t,url:a})},symbol:"reload",title:Liferay.Language.get("relaunch")}),l.default.createElement(n.ClayButtonWithIcon,{className:"component-action sidenav-close text-secondary",displayType:"unstyled",symbol:"times",title:Liferay.Language.get("close")})))},IssueDetailSidebarHeader=()=>{const{selectedIssue:e}=(0,l.useContext)(o.StoreStateContext),t=(0,l.useContext)(o.StoreDispatchContext);return l.default.createElement("div",{className:"d-flex justify-content-between p-3 sidebar-header"},l.default.createElement("div",{className:"d-flex"},l.default.createElement(n.ClayButtonWithIcon,{className:"align-items-start component-action flex-shrink-0 mr-2 sidenav-back text-secondary",displayType:"unstyled",onClick:()=>{t({issue:null,type:r.SET_SELECTED_ISSUE})},symbol:"angle-left",title:Liferay.Language.get("go-back")}),l.default.createElement("span",{className:"align-self-center font-weight-bold issue-detail-title"},e.title)),l.default.createElement(n.ClayButtonWithIcon,{className:"component-action flex-shrink-0 sidenav-close text-secondary",displayType:"unstyled",symbol:"times",title:Liferay.Language.get("close")}))}}}));
//# sourceMappingURL=SidebarHeader.js.map