import{j as e,S as h,p,Y as m,Z as b,$ as x,U as n,V as r,a0 as g}from"./vendor-mui-CBBEb17G.js";import{u as j}from"./index-DSw4vraS.js";import{dP as f}from"./index-DdWwwZXu.js";import"./vendor-utils-BveVE6Uf.js";import"./vendor-react-BBazpZul.js";import"./index-DQbmBtLN.js";import"./vendor-charts-tGnAgELZ.js";const T=()=>{var o,c;const{states:{reportData:d,loading:i}}=j(),t=d;return e.jsx(e.Fragment,{children:t?e.jsxs(h,{spacing:1,children:[e.jsx("h1",{className:"w-full text-center text-slate-700",children:t.title}),e.jsxs(p,{className:"!relative h-[75vh]  border rounded-lg",children:[i&&e.jsx(f,{}),e.jsx(m,{className:" !absolute top-0 bottom-0 left-0 right-0 !w-full !mb-[5px] overflow-auto rounded-lg",children:e.jsxs(b,{size:"small",stickyHeader:!0,children:[e.jsxs(x,{children:[e.jsxs(n,{children:[e.jsx(r,{width:120,align:"center",variant:"head",className:"!px-1 !bg-blue-500 !text-white border",rowSpan:2,children:"ماه"}),(o=t.headers)==null?void 0:o.map(a=>{var l,s;return e.jsx(r,{width:a.width||`${a.children.length??150}`,align:"center",variant:"head",className:"!px-1  border",colSpan:(l=a.children)==null?void 0:l.length,rowSpan:(s=a.children)!=null&&s.length?1:2,sx:{minWidth:150*(a.children.length||1),backgroundColor:a.backgroundColor??"#3b6df6",color:a.color??"#ffffff"},children:a.title},a.title)}),e.jsx(r,{width:200,align:"center",variant:"head",className:"!px-1 !bg-blue-500 !text-white border",rowSpan:2,children:"جمع"})]}),e.jsx(n,{className:"sticky top-[38px]",children:(c=t.headers)==null?void 0:c.flatMap(a=>a.children).map(a=>e.jsx(r,{width:a.width,align:"center",variant:"head",className:"!px-1  border",sx:{backgroundColor:a.backgroundColor??"#475569",color:a.color??"#ffffff"},children:a.title},a.title))})]}),e.jsx(g,{children:t.list?e.jsx(e.Fragment,{children:t.list.map(a=>e.jsx(n,{className:"cursor-pointer odd:bg-white even:bg-slate-100",children:Object.entries(a).map(([l,s])=>e.jsx(r,{className:"!px-1 border",variant:"body",align:"center",children:s},l))},Object.values(a)[0]))}):e.jsx(n,{children:e.jsx(r,{colSpan:7,align:"center",children:i?"در حال دریافت اطلاعات ...":"موردی جهت نمایش وجود ندارد"})})})]})})]})]}):e.jsx("h2",{className:"w-full p-8 text-center text-slate-700",children:"داده ای برای نمایش وجود ندارد"})})};export{T as default};
