import{a as h,x as C,b as v,r as w,aU as x,f as c,w as r,g as N,o as u,j as b,u as f,bi as g,bh as k,h as B,aC as l,X as p,aB as E}from"./index-e7fdb3d4.js";import{u as I}from"./usePageTitle-df55e3a5.js";const A=h({__name:"NotificationEdit",async setup(U){let t,i;const n=C(),e=v("notificationId"),a=w({...([t,i]=x(()=>n.notifications.getNotification(e.value)),t=await t,i(),t)});async function d(s){try{await n.notifications.updateNotification(e.value,s),l.push(p.notifications())}catch(o){E("Error updating notification","error"),console.warn(o)}}function _(){l.push(p.notifications())}return I("Edit Notification"),(s,o)=>{const m=N("p-layout-default");return u(),c(m,null,{header:r(()=>[b(f(g))]),default:r(()=>[a.value?(u(),c(f(k),{key:0,notification:a.value,"onUpdate:notification":o[0]||(o[0]=y=>a.value=y),onSubmit:d,onCancel:_},null,8,["notification"])):B("",!0)]),_:1})}}});export{A as default};
