import{d as h,m as v,E as w,r as C,aX as E,a as N,f as c,w as r,o as u,n as b,g as f,bl as g,bk as k,h as x,aG as l,X as p,aF as I}from"./index-18beffd6.js";import{u as B}from"./usePageTitle-5c97edcb.js";const F=h({__name:"NotificationEdit",async setup(V){let t,n;const i=v(),e=w("notificationId"),a=C({...([t,n]=E(()=>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){I("Error updating notification","error"),console.warn(o)}}function m(){l.push(p.notifications())}return B("Edit Notification"),(s,o)=>{const _=N("p-layout-default");return u(),c(_,null,{header:r(()=>[b(f(g))]),default:r(()=>[a.value?(u(),c(f(k),{key:0,notification:a.value,"onUpdate:notification":o[0]||(o[0]=y=>a.value=y),onSubmit:d,onCancel:m},null,8,["notification"])):x("",!0)]),_:1})}}});export{F as default};
