import{d as y,a7 as h,X as v,r as C,o as s,b as r,w as c,i as N,e as u,au as x,at as b,f as k,ar as f,Z as l,p,W as g}from"./index.a93ec448.js";import{u as A}from"./useRouteParam.ba3137c3.js";const V=y({__name:"NotificationEdit",async setup(B){let t,n;const i=A("notificationId"),o=h({...([t,n]=v(()=>f.getNotification(i.value)),t=await t,n(),t)});async function _(e){try{await f.updateNotification(i.value,e),l.push(p.notifications())}catch(a){g("Error updating notification","error"),console.warn(a)}}function m(){l.push(p.notifications())}return(e,a)=>{const d=C("p-layout-default");return s(),r(d,null,{header:c(()=>[N(u(x))]),default:c(()=>[o.value?(s(),r(u(b),{key:0,notification:o.value,"onUpdate:notification":a[0]||(a[0]=w=>o.value=w),onSubmit:_,onCancel:m},null,8,["notification"])):k("",!0)]),_:1})}}});export{V as default};
