2 lines
3.0 KiB
JavaScript
2 lines
3.0 KiB
JavaScript
import{P as O}from"./Page.f00bcef1.js";import{o as A,r as a,Z as F,a3 as G,$ as H,j as e,ay as x,T as y,F as V,f as _,a6 as $,S as R,a2 as U,a4 as W}from"./index.4f61bfb1.js";import{T as Z}from"./Table.97dcc15d.js";import{T as q}from"./TableMoreMenu.21abbe6d.js";import{d as z}from"./VisibilityOutlined.233870d0.js";import{L as o}from"./Label.3353ed6f.js";import{H as J}from"./HeaderBreadcrumbs.dda529db.js";import{G as P}from"./Grid.c1e049cd.js";import"./Box.684d1ca8.js";import"./TablePagination.a4d6066e.js";import"./KeyboardArrowRight.4abfe972.js";import"./LastPage.9ed3be5b.js";import"./TableRow.8e8e6be4.js";import"./TextField.4a80d643.js";import"./Search.aaf8524e.js";import"./TableContainer.fe9d4d86.js";import"./LinearProgress.7ce3ba86.js";import"./TableHead.be2e068b.js";import"./jsx-runtime_commonjs-proxy.6387488a.js";function K(){const n=A(),{corporateValue:p}=a.exports.useContext(F),[b,I]=a.exports.useState([]),[D,i]=a.exports.useState(!0),T={isLoading:D,setIsLoading:i},[r,l]=G(),[s,C]=a.exports.useState({}),w={searchParams:r,setSearchParams:l,appliedParams:s,setAppliedParams:C},[m,v]=a.exports.useState("asc"),[d,E]=a.exports.useState("fullName"),N={order:m,setOrder:v,orderBy:d,setOrderBy:E},[k,u]=a.exports.useState(0),[L,g]=a.exports.useState(10),[f,h]=a.exports.useState({current_page:0,from:0,last_page:0,links:[],path:"",per_page:0,to:0,total:0}),M={page:k,setPage:u,rowsPerPage:L,setRowsPerPage:g,paginationTable:f,setPaginationTable:h},B=[{id:"memberId",align:"left",label:"Member ID",isSort:!0},{id:"fullName",align:"left",label:"Name",isSort:!0},{id:"start_date",align:"center",label:"Start Date",isSort:!0},{id:"end_date",align:"center",label:"End Date",isSort:!0},{id:"status",align:"center",label:"Status",isSort:!0},{id:"action",align:"center",label:"",isSort:!0}];return a.exports.useEffect(()=>{(async()=>{i(!0),await new Promise(t=>setTimeout(t,250));const S=Object.keys(s).length!==0?s:Object.fromEntries([...r.entries(),["order",m],["orderBy",d]]),c=await H.get(`${p}/members?type=employee-data`,{params:{...S}});if(l(S),I(c.data.data.map(t=>({...t,status:t.status===1?e(o,{color:"success",children:"Active"}):e(o,{color:"error",children:"Inactive"}),start_date:e(o,{children:t.start_date?x(t.start_date):""}),end_date:e(o,{children:t.end_date?x(t.end_date):""}),fullName:e(y,{variant:"body2",children:t.fullName}),memberId:e(y,{variant:"body2",children:t.memberId}),action:e(q,{actions:e(V,{children:_($,{onClick:()=>n("/employee-data/user-profile/"+t.personId),children:[e(z,{}),"View"]})})})}))),h(c.data),g(c.data.per_page),r.get("page")){const t=parseInt(r.get("page"))-1;f.current_page=t,u(t)}i(!1)})()},[s,r,m,d,l,p]),e(R,{children:e(Z,{headCells:B,rows:b,orders:N,paginations:M,loadings:T,params:w})})}function fe(){const{themeStretch:n}=U();return e(O,{title:"Employee Data",children:_(W,{maxWidth:n?!1:"xl",children:[e(J,{heading:"Employee Data",links:[{name:"Case Management"},{name:"Employee Data",href:"/employee-data"}]}),e(P,{container:!0,children:e(P,{item:!0,xs:12,lg:12,md:12,children:e(K,{})})})]})})}export{fe as default};
|