import{aI as i,c4 as j,bc as g,az as S,ao as e,aF as w,L as P,aq as m,bU as c,m as b,o as v}from"./app-k0jcl5PQ.js";import{C as u}from"./_XP6hjk3.chunk.js";const r="classrooms.deleteClassroom",o=P.encloseNamespace(r);function L(s){const[d,n]=i.useState(!1),[a,p]=i.useState(""),h=j(),l=g(),t=S(u.getClassroom(s.id));function x(){n(!0),b(h,u.deleteClassroom(s.id,()=>{n(!1),v.logUserAction({id:s.id},s.analyticsOptions),l.success(o("success",{name:t.data.name,escapeText:!0})),s.closePopup()},()=>{n(!1),l.error(o("error",{name:t.data.name,escapeText:!0}))}))}const f=!t.data;return e.jsx(w,{title:o("title"),closePopup:s.closePopup,showLoadingSpinner:f,children:!!t.data&&e.jsxs(e.Fragment,{children:[e.jsx("p",{children:e.jsx(m,{namespace:r,phrase:"info"})}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"confirmation",className:"fw-normal",children:e.jsx(m,{namespace:r,phrase:"label",options:{escapeText:!0}})}),e.jsx("input",{id:"confirmation",className:"form-control w-33",onChange:C=>p(C.target.value),value:a})]}),e.jsxs(c,{children:[e.jsx(c.Cancel,{onClick:s.closePopup}),e.jsx(c.Submit,{onClick:x,variant:"danger",text:o("remove"),showSpinner:d,disabled:(a==null?void 0:a.toLowerCase())!=="delete"})]})]})})}export{L as DeleteClassroomView};
//# sourceMappingURL=ZDaV4Xyt.chunk.js.map
