import{k as l,l as u,o as m,j as a,E as p,G as d,az as x,ax as g,a9 as n}from"./app-BgLa5dit.js";import{O as i}from"./DNClpFKN.chunk.js";function j(e){const o=l(),s=u(),t=m(i.getOrganisation(e.id));async function r(c){try{await o(i.updateOrganisation(e.id,{orgType:t.data.orgType,name:c.name})),s.success("Successfully updated the organisation name")}catch{s.error("Failed to update the organisation name. Please try again.")}finally{e.closePopup()}}return a.jsx(p,{title:"Update organisation name",closePopup:e.closePopup,showLoadingSpinner:!t.hasCompleted,children:a.jsx(d,{initialValues:{name:t.data.name},onSubmit:r,children:()=>a.jsxs(x,{children:[a.jsx(g,{name:"name",type:"text"}),a.jsxs(n,{children:[a.jsx(n.Cancel,{onClick:e.closePopup,text:"Cancel"}),a.jsx(n.Submit,{text:"Save",variant:"dark"})]})]})})})}export{j as UpdateOrganisationNameView};
//# sourceMappingURL=C6NPv4TK.chunk.js.map
