import{aI as h,az as f,bc as x,c4 as C,ao as s,aF as A,L as g,aq as T,bU as n,ci as k,m as j,o as L,p as P,W as v,ch as w,r as y,E as O,f as b,e as R,A as E,l as B}from"./app-k0jcl5PQ.js";import{O as D}from"./fbx3ux4i.chunk.js";import{C as i}from"./_XP6hjk3.chunk.js";const r="classrooms.retrieveClassroom",t=g.encloseNamespace(r);function H(a){const[p,o]=h.useState(!1),e=f(i.getClassroom(a.id)),c=x(),l=C();function u(){o(!0);const S={name:e.data.name,id:e.data.id,status:D.getStatusAsNumber(k.Active)};j(l,i.editClassroom(S,m,d))}function m(){o(!1),L.logUserAction({id:a.id},{entity:O.Classroom,actionType:y.Archive,descriptor:w.Off,workflowPhase:v.Complete,location:P.Popup}),c.success({heading:B.Success,type:E.Success,message:t("successText",{name:e.data.name,escapeText:!0}),appLink:{application:R.CLASSROOMS,action:b.Classrooms.CLASSROOM_STUDENTS,args:[e.data.id]},appLinkText:t("successAppLinkText"),appLinkClassName:"info-link"}),a.closePopup()}function d(){o(!1),c.success(t("error",{name:e.data.name,escapeText:!0}))}return s.jsx(A,{closePopup:a.closePopup,title:t("retrieve"),showLoadingSpinner:!e.data,children:!!e.data&&s.jsxs(s.Fragment,{children:[s.jsx("p",{children:s.jsx(T,{namespace:r,phrase:"info",options:{name:e.data.name,escapeText:!0}})}),s.jsxs(n,{children:[s.jsx(n.Cancel,{onClick:a.closePopup}),s.jsx(n.Submit,{onClick:u,variant:"dark",text:t("retrieve"),showSpinner:p})]})]})})}export{H as RetrieveClassroomView};
//# sourceMappingURL=am7hKZzS.chunk.js.map
