(this.webpackJsonpimonitornextgen=this.webpackJsonpimonitornextgen||[]).push([[113],{2121:function(e,t,a){"use strict";a.r(t);var r=a(215),n=a(26),o=a(8),s=a(0),l=a.n(s),i=a(53),c=a(17),u=a(199),d=a(30),m=a(271),f=a.n(m),h=a(280),v=a.n(h),g=a(191),p=a(507),b=a(596),y=a(239),O=a.n(y),I=[{dataField:"healthWorkerId",text:"Health Worker Id",sort:!0},{dataField:"healthWorkerName",text:"Health Worker Name",sort:!0},{dataField:"healthWorkerEmail",text:"Health Worker Email",sort:!0},{dataField:"formsEntry",text:"Total Forms Submitted",sort:!0}],x=a(200);t.default=Object(d.b)((function(e){var t=e.communityData,a=e.selectedLang;return{UUID:t.communityId,languageId:a.languageId}}))((function(e){var t=e.UUID,a=e.languageId,d=Object(g.a)(),h=Object(n.a)(d,1)[0],y=Object(s.useState)(!1),j=Object(n.a)(y,2),k=j[0],S=j[1],E=Object(s.useState)(""),w=Object(n.a)(E,2),W=w[0],N=w[1],P=Object(s.useState)(I.slice().map((function(e){return Object(o.a)(Object(o.a)({},e),{},{text:h(e.text)})}))),F=Object(n.a)(P,2),T=F[0],D=F[1],H=Object(s.useState)([]),M=Object(n.a)(H,2),L=M[0],z=M[1];Object(s.useEffect)((function(){var e={communityId:t,languageId:a,limitFrom:0,limitTo:99,limitToApply:!0};S(!0),u.a.post(i.countOfHealthWorkerIdsBySurveyId,e).then((function(e){var t=e.data.data;t.countOfHealthWorkerIdsBySurveyIdData||N("No Data available");var a=null===t||void 0===t?void 0:t.countOfHealthWorkerIdsBySurveyIdData;if(a&&a.length>0){var n=[],o=a.map((function(e){var a={},r=0;e.countOfHealthWorkerIdsBySurveyId.forEach((function(e){var o=t.surveyList.find((function(t){return t.surveyId===e.surveyId}));o&&(a[o.name]=e.surveyWiseCount,r+=e.surveyWiseCount,n.push({dataField:o.name,text:o.name,sort:!0}))}));var o=t.surveyList.find((function(t){return t.surveyId===e.lastSubmittedSurveyId})),s=o?o.name:"";return a.healthWorkerId=e.healthWorkerId,a.healthWorkerName=e.healthWorkerName,a.healthWorkerEmail=e.healthWorkerEmail,a.formsEntry=r,a.lastSubmittedSurveyId=s,a}));n.push({dataField:"lastSubmittedSurveyId",text:"Last Form Submitted",sort:!0}),D([].concat(Object(r.a)(T),n)),z(o)}S(!1)})).catch((function(e){S(!1),N("Something is wrong");var t={component:"HealthWorkerStatistics",method:"useEffect",error:e};Object(c.logError)(t)}))}),[]);var C={page:1,sizePerPageList:[{text:"5",value:5},{text:"10",value:10},{text:"All",value:L.length}],sizePerPage:10,pageStartIndex:1,paginationSize:3,prePageText:h("Prev"),nextPageText:h("Next"),firstPageText:h("First"),lastPageText:h("Last"),showTotal:!0,sizePerPageOptionRenderer:function(e){var t=e.text,a=e.page,r=e.onSizePerPageChange;return l.a.createElement("li",{key:t,role:"presentation",className:"dropdown-item"},l.a.createElement("a",{href:"#",tabIndex:"-1",role:"menuitem","data-page":a,onMouseDown:function(e){e.preventDefault(),r(a)}},t))}};return l.a.createElement(l.a.Fragment,null,l.a.createElement(x.default,{isLoading:k}),l.a.createElement(p.a,{className:"health-worker-statistics"},l.a.createElement(b.a,{className:"health-worker-row"},l.a.createElement("div",{className:"table_react_bootstrap responsive_table p-0px w-100"},l.a.createElement(O.a,{keyField:"id",data:L,columns:T},(function(e){return l.a.createElement(f.a,Object.assign({classes:"health-worker-statistics-table",key:9999*Math.random()},e.baseProps,{bootstrap4:!0,noDataIndication:h(W),pagination:v()(C),striped:!0,hover:!0,responsive:!0,defaultSorted:m.defaultSorted,wrapperClasses:"table-responsive",exportCSV:!0}))}))))))}))},507:function(e,t,a){"use strict";var r=a(2),n=a(3),o=a(0),s=a.n(o),l=a(1),i=a.n(l),c=a(5),u=a.n(c),d=a(14),m=["className","cssModule","fluid","tag"],f={tag:d.n,fluid:i.a.oneOfType([i.a.bool,i.a.string]),className:i.a.string,cssModule:i.a.object},h=function(e){var t=e.className,a=e.cssModule,o=e.fluid,l=e.tag,i=Object(n.a)(e,m),c="container";!0===o?c="container-fluid":o&&(c="container-"+o);var f=Object(d.j)(u()(t,c),a);return s.a.createElement(l,Object(r.a)({},i,{className:f}))};h.propTypes=f,h.defaultProps={tag:"div"},t.a=h},596:function(e,t,a){"use strict";var r=a(2),n=a(3),o=a(0),s=a.n(o),l=a(1),i=a.n(l),c=a(5),u=a.n(c),d=a(14),m=["className","cssModule","noGutters","tag","form","widths"],f=i.a.oneOfType([i.a.number,i.a.string]),h={tag:d.n,noGutters:i.a.bool,className:i.a.string,cssModule:i.a.object,form:i.a.bool,xs:f,sm:f,md:f,lg:f,xl:f},v={tag:"div",widths:["xs","sm","md","lg","xl"]},g=function(e){var t=e.className,a=e.cssModule,o=e.noGutters,l=e.tag,i=e.form,c=e.widths,f=Object(n.a)(e,m),h=[];c.forEach((function(t,a){var r=e[t];if(delete f[t],r){var n=!a;h.push(n?"row-cols-"+r:"row-cols-"+t+"-"+r)}}));var v=Object(d.j)(u()(t,o?"no-gutters":null,i?"form-row":"row",h),a);return s.a.createElement(l,Object(r.a)({},f,{className:v}))};g.propTypes=h,g.defaultProps=v,t.a=g}}]);
//# sourceMappingURL=113.f707a1c7.chunk.js.map