import{R as x,l as h,j as e,bA as j,b7 as s,bi as y,bT as b,a9 as i,F as r,o as d,k as g,E as S}from"./app-BgLa5dit.js";import{B as p}from"./DpUpv6rY.chunk.js";import{J as l}from"./DfIMhO3y.chunk.js";import"./CG7zbly5.chunk.js";import"./m4aqaK_l.chunk.js";import"./MEkA24R1.chunk.js";import"./C53kfXmd.chunk.js";import"./DUpYPoLs.chunk.js";const P="_summary_bpzsl_1",f={summary:P},o="userManager.bulkActionSummary";function k(t){const[n,a]=x.useState(!1),c=h();function u(){a(!0),t.onClickExportLog().then(()=>c.success(r.getPhrase(o,"exportSuccess"))).catch(()=>c.error(r.getPhrase(o,"exportError"))).finally(()=>a(!1))}const m=p.mapDataTypeToUserType(t.job.dataType);return e.jsxs(j.Provider,{value:o,children:[e.jsx("p",{children:e.jsx(s,{phrase:m===b.Learner?"detailsStudent":"detailsStaff",options:{name:t.job.submitterName,actionName:p.mapJobTypeToName(t.job.type),date:y.format(t.job.dateCreated,"Do MMMM YYYY"),smartCount:t.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:t.summary.totalProcessed}})}),e.jsx("p",{className:"mb-1",children:e.jsx(s,{phrase:"totalSucceeded",options:{count:t.summary.totalSucceeded}})}),e.jsx("p",{className:"mb-1",children:e.jsx(s,{phrase:"totalErrored",options:{count:t.summary.totalErrored}})}),e.jsx("p",{className:"mb-0",children:e.jsx(s,{phrase:"totalNoAction",options:{count:t.summary.totalNoAction}})})]}),e.jsxs(i,{children:[e.jsx(i.Cancel,{text:r.getPhrase(o,"close"),onClick:t.closePopup}),e.jsx(i.Submit,{text:r.getPhrase(o,"exportLog"),variant:"dark",onClick:u,showSpinner:n})]})]})}const N="userManager.bulkActionSummaryView";function M(t){const n=d(l.getJob(t.id)),a=d(l.getJobSummary(t.id)),c=g();function u(){return c(l.sendJobReports(t.customerId,[t.id]))}const m=!!n.data&&!!a.data;return e.jsx(S,{title:r.getPhrase(N,"title"),closePopup:t.closePopup,showLoadingSpinner:!m,children:m&&e.jsx(k,{job:n.data,summary:a.data,onClickExportLog:u,closePopup:t.closePopup})})}export{M as BulkActionSummaryView};
//# sourceMappingURL=BpcjTe6c.chunk.js.map
