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