(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/notifications/panel-notifications-settings"],{1207:(e,t,s)=>{"use strict";s.r(t);var n=s(153),i=s(260),a=s.n(i),o=s(143),c=s(154);const l=({settings:e})=>{const[t,s]=(0,n.useState)(!1),[i,a]=(0,n.useState)(e.sendToAdmin);return(0,n.createElement)(c.Switch,{checked:i,onChange:async()=>{s(!0);const{status:t,statusMessages:n}=await o.api.post(`/admin/notifications/panel-notifications-toggle/id/${e.id}`);(0,o.clearStatusMessages)(),n.forEach((({status:e,content:t})=>{(0,o.addStatusMessage)(e,t)})),s(!1),"success"===t&&a(!i)},loading:t})};l.propTypes={settings:a().object.isRequired},t.default=({notificationsList:e})=>{const t=o.Locale.getSection("admin.controllers.notifications.template-settings-list");new o.Hint({renderTo:"panel-notifications-list",hint:t.lmsg("hint")}),new o.Panel({cls:"list-box",renderTo:"panel-notifications-list",items:[new o.List({...e,id:"notifications-list",searchOveral:"name",disabledSelectHint:t.lmsg("disabledSelectHint"),columns:[{header:t.lmsg("name"),sortable:!0,dataIndex:"name"},{header:t.lmsg("context"),sortable:!0,dataIndex:"context"},{header:t.lmsg("sendToAdmin"),cls:"number t-r",renderer:e=>(0,n.createElement)(l,{settings:e})}]})]})}}}]);
//# sourceMappingURL=panel-notifications-settings.js.map?754867a517b59932a514