import{d as v,a as y,M as h,r as w,bb as C,b as N,e as c,w as r,o as u,h as k,u as f,bB as x,bA as g,f as B,aX as l,ab as p,aW as E}from"./index-562c8470.js";import{u as A}from"./usePageTitle-ad3dbf10.js";const V=v({__name:"NotificationEdit",async setup(I){let t,n;const i=y(),e=h("notificationId"),a=w({...([t,n]=C(()=>i.notifications.getNotification(e.value)),t=await t,n(),t)});async function d(s){try{await i.notifications.updateNotification(e.value,s),l.push(p.notifications())}catch(o){E("Error updating notification","error"),console.warn(o)}}function _(){l.push(p.notifications())}return A("Edit Notification"),(s,o)=>{const m=N("p-layout-default");return u(),c(m,null,{header:r(()=>[k(f(x))]),default:r(()=>[a.value?(u(),c(f(g),{key:0,notification:a.value,"onUpdate:notification":o[0]||(o[0]=b=>a.value=b),onSubmit:d,onCancel:_},null,8,["notification"])):B("",!0)]),_:1})}}});export{V as default};
