"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/notifications/panel-notifications-settings"],{1826:(t,e,s)=>{s.r(e),s.d(e,{default:()=>d});var n=s(222),i=s(224),a=s.n(i),o=s(97),c=s(223);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};const d=({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?3c042a53b778229db801