import{aI as x,bc as h,iW as d,ao as e,aO as y,aq as s,h as b,cb as j,bU as i,L as r,az as p,b0 as g,aF as S}from"./app-k0jcl5PQ.js";import{J as l}from"./hKqzfsO4.chunk.js";import"./fstW5ZQE.chunk.js";const P="_summary_bpzsl_1",f={summary:P},o="userManager.bulkActionSummary";function N(a){const[n,t]=x.useState(!1),c=h();function u(){t(!0),a.onClickExportLog().then(()=>c.success(r.getPhrase(o,"exportSuccess"))).catch(()=>c.error(r.getPhrase(o,"exportError"))).finally(()=>t(!1))}const m=d.mapDataTypeToUserType(a.job.dataType);return e.jsxs(y.Provider,{value:o,children:[e.jsx("p",{children:e.jsx(s,{phrase:m===j.Learner?"detailsStudent":"detailsStaff",options:{name:a.job.submitterName,actionName:d.mapJobTypeToName(a.job.type),date:b.format(a.job.dateCreated,"Do MMMM YYYY"),smartCount:a.summary.totalProcessed}})}),e.jsx("p",{className:"fw-bold",children:e.jsx(s,{phrase:"summary"})}),e.jsxs("div",{className:`${f.summary} rounded-3 p-3 mb-3`,children:[e.jsx("p",{className:"mb-1",children:e.jsx(s,{phrase:"totalProcessed",options:{count:a.summary.totalProcessed}})}),e.jsx("p",{className:"mb-1",children:e.jsx(s,{phrase:"totalSucceeded",options:{count:a.summary.totalSucceeded}})}),e.jsx("p",{className:"mb-1",children:e.jsx(s,{phrase:"totalErrored",options:{count:a.summary.totalErrored}})}),e.jsx("p",{className:"mb-0",children:e.jsx(s,{phrase:"totalNoAction",options:{count:a.summary.totalNoAction}})})]}),e.jsxs(i,{children:[e.jsx(i.Cancel,{text:r.getPhrase(o,"close"),onClick:a.closePopup}),e.jsx(i.Submit,{text:r.getPhrase(o,"exportLog"),variant:"dark",onClick:u,showSpinner:n})]})]})}const k="userManager.bulkActionSummaryView";function T(a){const n=p(l.getJob(a.id)),t=p(l.getJobSummary(a.id)),c=g();function u(){return c(l.sendJobReports([a.id]))}const m=!!n.data&&!!t.data;return e.jsx(S,{title:r.getPhrase(k,"title"),closePopup:a.closePopup,showLoadingSpinner:!m,children:m&&e.jsx(N,{job:n.data,summary:t.data,onClickExportLog:u,closePopup:a.closePopup})})}export{T as BulkActionSummaryView};
//# sourceMappingURL=g42nUZWf.chunk.js.map
