import{j as t,I as l,b as C}from"./mui-vendor-CkIVaoQP.js";import{r,u as d}from"./react-vendor-CmFgShSM.js";import{L as p,iL as f,h,Q as x,iM as m,iN as y,G as n,S as j}from"./index-Vwb3Bce5.js";import{u as E,f as A}from"./redux-vendor-B7uoacJt.js";import{R as S}from"./ResponsiveTable-DugzNG82.js";import"./FilterAlt-CTDmPS36.js";import"./styled-components.browser.esm-gS9mh05b.js";const g=()=>{const s=E(),{avicultureHallsInfo:a}=A(e=>e.avicultureSlice),[o,c]=r.useState([]),i=d();return r.useEffect(()=>{s(p()),s(f()).then(()=>{s(h())})},[]),r.useEffect(()=>{const e=a==null?void 0:a.map(u=>[u.hall,u.hatchingState==="active"?"دارد":"ندارد",x(new Date(u==null?void 0:u.hatchingDate),"yyyy/MM/dd"),u.inspections,t.jsx(l,{disabled:u.inspections===0,"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>i(y+u.poultryKey+"/"+u.hall),children:t.jsx(m,{})},1)]);c(e)},[a]),t.jsx(C,{display:"flex",justifyContent:"center",children:t.jsx(n,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:t.jsx(n,{justifyContent:"center",my:j.MEDIUM,children:t.jsx(S,{paginated:!0,title:"لیست سالن ها",columns:["شماره سالن","جوجه ریزی فعال","تاریخ آخرین جوجه ریزی","تعداد بازرسی ها","سوابق بازرسی"],data:o})})})})};export{g as default};
