import{d as y,M as v,U as w,i as C,bk as N,k as h,c,l as r,o as u,n as k,u as f,bK as x,bJ as g,a as E,af as l,b3 as p,b2 as T}from"./index-gULJbqdd.js";import{u as U}from"./usePageTitle-HrbxxOEb.js";const V=y({__name:"NotificationEdit",async setup(B){let t,i;const n=v(),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),p.push(l.notifications())}catch(o){T("Error updating notification","error"),console.warn(o)}}function _(){p.push(l.notifications())}return U("Edit Notification"),(s,o)=>{const m=h("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"])):E("",!0)]),_:1})}}});export{V as default};
