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