import{d as y,D as h,b as v,f as w,bj as C,c,h as r,i as N,o as u,k,u as f,bJ as x,bI as E,a as g,ae as l,b2 as p,b1 as I}from"./index-WCZ_4nWW.js";import{u as B}from"./usePageTitle-Y7n4a-YH.js";const j=y({__name:"NotificationEdit",async setup(D){let t,i;const n=h(),e=v("notificationId"),a=w({...([t,i]=C(()=>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 _(){p.push(l.notifications())}return B("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(E),{key:0,notification:a.value,"onUpdate:notification":o[0]||(o[0]=b=>a.value=b),onSubmit:d,onCancel:_},null,8,["notification"])):g("",!0)]),_:1})}}});export{j as default};
