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