import{ao as t,f1 as h,aI as o,ax as U,e9 as k,aq as m,cb as c,v as p,o as x,W as A,r as y,E as w,p as T,az as L,bu as S,iO as b,bN as v,L as j}from"./app-k0jcl5PQ.js";import{B,u as M,a as N}from"./DaGep5vp.chunk.js";import{B as R}from"./9ic7OkpL.chunk.js";import{I as _}from"./DXJ2-V8v.chunk.js";import{W as I}from"./2FvGdRks.chunk.js";import"./CpGXOT1_.chunk.js";import"./DkDkjje4.chunk.js";import"./Djb1f-EX.chunk.js";import"./CCtuxSlD.chunk.js";import"./CPXlV0fg.chunk.js";import"./CnmbO5oy.chunk.js";import"./BDviDDog.chunk.js";import"./wCY37Ze3.chunk.js";const W="_partialCount_y1jm1_1",E={partialCount:W};function F(){return t.jsx("div",{className:`partial-loading-background ${E.partialCount}`})}const d="userManager.bulkUserActionsReviewAccounts";function O(e){const s=h(),n=o.useRef(null),[i,r]=U(k.BULK_USER_ACTIONS);o.useEffect(()=>{var a;r("scrollContainer",(a=n.current)==null?void 0:a.view)},[n.current]),o.useEffect(()=>{r("action",null),r("subAction",null)},[]);const u=o.useCallback(a=>t.jsx(R,{user:a,userType:e.userType,imageCdnUrl:e.imageCdnUrl,onClickRemoveUser:e.removeUser},a.id),[e.removeUser]);function l(){s.unlock(B),p.trigger(e.appLinks.userManager),x.logUserAction({userCount:e.userCount},{location:T.BulkUserActionsWizard,entity:w.User,actionType:y.BulkAction,workflowPhase:A.Back})}return t.jsxs("div",{className:"pb-3",children:[t.jsx("h2",{className:"h4",children:t.jsx(m,{namespace:d,phrase:e.userType===c.Learner?"headingStudents":"headingStaff"})}),typeof e.userCount=="number"?t.jsx("p",{className:"fw-semibold",children:t.jsx(m,{namespace:d,phrase:e.userType===c.Learner?"selectedStudents":"selectedStaff",options:{smartCount:e.userCount}})}):t.jsx(F,{}),(!i.allUsersSelected||i.allUsersCount!==e.userCount)&&t.jsx("button",{className:"btn btn-outline-dark mb-3",onClick:l,children:t.jsx(m,{namespace:d,phrase:e.userType===c.Learner?"addMoreStudents":"addMoreStaff"})}),t.jsx(I,{tableHeightOffset:e.tableHeightOffset,items:e.users,rowHeight:55,getComponent:u,ref:n,staticComponentBelowRows:!!(e.hasMore||e.isFetching)&&t.jsx(_,{isFetching:e.isFetching,fetchNext:e.fetchNext})})]})}const H="userManager.bulkActionsReviewAccounts";function ee(e){var C;const{users:s,count:n,isFetching:i,removeUser:r,hasMore:u,fetchNext:l}=M(e.userType),a=L(S.config()),f=b(e.userType);v({title:j.getPhrase(H,e.userType===c.Learner?"pageTitleStudents":"pageTitleStaff")});const g=!!(s!=null&&s.length);return t.jsx(N,{appLinks:f,userType:e.userType,users:s,currentStep:"review-accounts",userCount:n,loaded:g,children:g&&t.jsx(O,{users:s,imageCdnUrl:(C=a.data)==null?void 0:C.imageCdnUrl,removeUser:r,hasMore:u,fetchNext:l,isFetching:i,appLinks:f,userType:e.userType,userCount:n})})}export{ee as BulkUserActionsReviewAccountsView};
//# sourceMappingURL=CFyotFe0.chunk.js.map
