Liferay.Loader.define("@liferay/content-dashboard-web@2.0.83/js/components/SidebarPanelInfoView/Subscribe",["module","exports","require","@frontend-taglib-clay$clayui/button","frontend-js-web","liferay!frontend-js-react-web$react","../Sidebar"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r("@frontend-taglib-clay$clayui/button"),n=r("frontend-js-web"),o=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 r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=a?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}const{SidebarContext:e}=r("../Sidebar");var _default=({disabled:t,icon:r,label:i,url:c})=>{const{fetchData:l}=(0,o.useContext)(e);return o.default.createElement(a.ClayButtonWithIcon,{"aria-label":i,className:"component-action mr-2","data-tooltip-align":"bottom",disabled:t,displayType:"unstyled",onClick:async()=>{if(!t)try{const{ok:e}=await(0,n.fetch)(c);if(!e)throw new Error("Failed to fetch ".concat(c));await l(),(0,n.openToast)({message:Liferay.Language.get("your-request-completed-successfully"),type:"success"})}catch(e){(0,n.openToast)({message:Liferay.Language.get("an-unexpected-error-occurred"),type:"danger"})}},symbol:r,title:i})};t.default=_default}}));
//# sourceMappingURL=Subscribe.js.map