import{d as y,M as v,b as w,f as C,bi as N,c,i as r,j as h,o as u,m as k,u as f,bI as x,bH as E,a as g,ae as l,b1 as p,b0 as I}from"./index-bD6G21oH.js";import{u as B}from"./usePageTitle-27XdpEbQ.js";const A=y({__name:"NotificationEdit",async setup(M){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){I("Error updating notification","error"),console.warn(o)}}function m(){p.push(l.notifications())}return B("Edit Notification"),(s,o)=>{const _=h("p-layout-default");return u(),c(_,null,{header:r(()=>[k(f(x))]),default:r(()=>[a.value?(u(),c(f(E),{key:0,notification:a.value,"onUpdate:notification":o[0]||(o[0]=b=>a.value=b),onSubmit:d,onCancel:m},null,8,["notification"])):g("",!0)]),_:1})}}});export{A as default};
