"use strict";(self.webpackChunkparsizteb=self.webpackChunkparsizteb||[]).push([[490],{96490:(e,l,r)=>{r.r(l),r.d(l,{default:()=>p});var n=r(35298),t=r(33132),i=r(2988),a=r(42820),d=r(37072),s=r(67648),o=r(39302),c=r(25384),h=r(15980),u=r(73906),x=r(65043),v=r(70579);const p=()=>{var e,l,r;const{states:{reportData:p,loading:f}}=(0,n.k)(),g=p,[b,m]=(0,x.useState)(1),j=e=>{let l=0;for(let r of e.children)r.children.length?l+=r.children.length:l+=1;return l};return(0,x.useEffect)((()=>{g&&(null!==g&&void 0!==g&&g.headers.some((e=>e.children.some((e=>{var l;return null===(l=e.children)||void 0===l?void 0:l.length}))))?m(3):null!==g&&void 0!==g&&g.headers.some((e=>e.children.length>0))?m(2):m(1))}),[g]),(0,v.jsx)(v.Fragment,{children:g?(0,v.jsxs)(t.A,{spacing:1,children:[(0,v.jsx)("h1",{className:"w-full text-center text-slate-700",children:g.title}),(0,v.jsxs)(i.A,{className:"!relative h-[75vh]  border rounded-lg",children:[f&&(0,v.jsx)(u.A,{}),(0,v.jsx)(a.A,{className:" !absolute top-0 bottom-0 left-0 right-0 !w-full !mb-[5px] overflow-auto rounded-lg",children:(0,v.jsxs)(d.A,{size:"small",stickyHeader:!0,children:[(0,v.jsxs)(s.A,{children:[(0,v.jsxs)(o.A,{children:[(0,v.jsx)(c.A,{width:150,align:"center",variant:"head",className:"!px-1 !bg-blue-500 !text-white border",rowSpan:b,sx:{minWidth:150},children:"\u0634\u0631\u062d \u062e\u062f\u0645\u0627\u062a"}),null===(e=g.headers)||void 0===e?void 0:e.map((e=>{var l,r,n,t;return(0,v.jsx)(c.A,{width:e.width||"".concat(null!==(l=e.children.length)&&void 0!==l?l:150),align:"center",variant:"head",className:"!px-1  border",colSpan:j(e),rowSpan:(t=e,t.children.length?1:b),sx:{minWidth:150*(e.children.length||1),backgroundColor:null!==(r=e.backgroundColor)&&void 0!==r?r:"#3b6df6",color:null!==(n=e.color)&&void 0!==n?n:"#ffffff"},children:e.title},e.title)})),(0,v.jsx)(c.A,{width:150,align:"center",variant:"head",className:"!px-1 !bg-blue-500 !text-white border",rowSpan:b,sx:{minWidth:150},children:"\u062c\u0645\u0639 \u062f\u0631\u0622\u0645\u062f"})]}),(0,v.jsx)(o.A,{className:"sticky top-[38px]",children:null===(l=g.headers)||void 0===l?void 0:l.flatMap((e=>e.children)).map((e=>{var l,r;return(0,v.jsx)(c.A,{width:e.width,align:"center",variant:"head",className:"!px-1  border",sx:{backgroundColor:null!==(l=e.backgroundColor)&&void 0!==l?l:"#475569",color:null!==(r=e.color)&&void 0!==r?r:"#ffffff"},colSpan:e.children.length||1,rowSpan:e.children.length?1:2,children:e.title},e.title)}))}),3===b&&(0,v.jsx)(o.A,{className:"sticky top-[76px]",children:null===(r=g.headers)||void 0===r?void 0:r.flatMap((e=>e.children)).flatMap((e=>e.children)).map(((e,l)=>{var r,n;return(0,v.jsx)(c.A,{width:null===e||void 0===e?void 0:e.width,align:"center",variant:"head",className:"!px-1  border",sx:{backgroundColor:null!==(r=null===e||void 0===e?void 0:e.backgroundColor)&&void 0!==r?r:"#475569",color:null!==(n=null===e||void 0===e?void 0:e.color)&&void 0!==n?n:"#ffffff"},children:e.title},e.title)}))})]}),(0,v.jsx)(h.A,{children:g.list?(0,v.jsx)(v.Fragment,{children:g.list.map((e=>(0,v.jsx)(o.A,{className:"cursor-pointer odd:bg-white even:bg-slate-100",children:Object.entries(e).map((e=>{let[l,r]=e;return(0,v.jsx)(c.A,{className:"!px-1 border",variant:"body",align:"center",children:r},l)}))},Object.values(e)[0])))}):(0,v.jsx)(o.A,{children:(0,v.jsx)(c.A,{colSpan:7,align:"center",children:f?"\u062f\u0631 \u062d\u0627\u0644 \u062f\u0631\u06cc\u0627\u0641\u062a \u0627\u0637\u0644\u0627\u0639\u0627\u062a ...":"\u0645\u0648\u0631\u062f\u06cc \u062c\u0647\u062a \u0646\u0645\u0627\u06cc\u0634 \u0648\u062c\u0648\u062f \u0646\u062f\u0627\u0631\u062f"})})})]})})]})]}):(0,v.jsx)("h2",{className:"w-full p-8 text-center text-slate-700",children:"\u062f\u0627\u062f\u0647 \u0627\u06cc \u0628\u0631\u0627\u06cc \u0646\u0645\u0627\u06cc\u0634 \u0648\u062c\u0648\u062f \u0646\u062f\u0627\u0631\u062f"})})}}}]);
//# sourceMappingURL=490.c594aa18.chunk.js.map