import{j as t,S as n,aN as h}from"./vendor-mui-CBBEb17G.js";import{a as r}from"./vendor-react-BBazpZul.js";import{B as g}from"./index-DQbmBtLN.js";import{cp as y,at as j,R as I,dD as N,I as o,aX as A,z as b,aQ as w}from"./index-DdWwwZXu.js";import"./vendor-utils-BveVE6Uf.js";import"./vendor-charts-tGnAgELZ.js";const E=()=>{const{GetAppointmentsListAsync:c,DeleteAppointmentsListAsync:l}=y(),d=j(),[m,a]=r.useState(!1),[p,u]=r.useState([]),s=async()=>{try{a(!0);const{data:e}=await c();e&&u(e)}finally{a(!1)}},f=async e=>{try{a(!0),d({content:"آیا از حذف پذیرش اطمینان دارید؟"}).then(async()=>{const{message:i}=await l({nationalNumber:e.nationalNumber,referingCode:e.referingCode});s()}).catch(()=>{})}finally{a(!1)}};r.useEffect(()=>{s()},[]);const x=[{title:" نام و نام خانوادگی بیمار",key:"fullName",dataIndex:"fullName",width:120,render:e=>e},{title:"کد ملی",key:"nationalNumber",dataIndex:"nationalNumber",width:100,render:e=>b(e)},{title:"تصویر پرسنلی",key:"memberImage",dataIndex:"memberImage",width:100,render:e=>t.jsx(h,{src:`data:image/png;base64,${e}`,sx:{width:"50px",height:"50px"}})},{title:"حذف",key:"referingCode",dataIndex:"referingCode",width:70,render:(e,i)=>t.jsx(w,{color:"error",size:"small",className:"!m-0 !p-0",onClick:()=>f(i),children:t.jsx(o.DeleteIcon,{})})}];return t.jsxs(n,{spacing:1,className:"!h-[calc(100vh-30px)]",children:[t.jsx(g,{prevRoutes:[{path:"/",title:"داشبورد"},{path:`/${I.doctors.armedForcesPage}`,title:"بیمه نیروهای مسلح"}],currentRoute:"لیست پذیرش"}),t.jsx(n,{direction:"row",alignItems:"center",spacing:2,children:t.jsx(N,{onClick:()=>s(),color:"info",children:t.jsx(o.RefreshIcon,{})})}),t.jsx(n,{className:"h-full",children:t.jsx(A,{data:p,columns:x,loading:m,rowKey:"referingCode"})})]})};export{E as default};
