import{d as y,M as h,U as v,h as w,bk as C,c,j as r,l as N,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 U}from"./index-bJiZR03d.js";import{u as j}from"./usePageTitle-wT6f1BZv.js";const T=y({__name:"NotificationEdit",async setup(B){let t,n;const i=h(),e=v("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),p.push(l.notifications())}catch(o){U("Error updating notification","error"),console.warn(o)}}function _(){p.push(l.notifications())}return j("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"])):E("",!0)]),_:1})}}});export{T as default};
