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