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