Files
aso/public/dashboard/assets/Index.34ff7b4f.js
2023-02-15 09:07:33 +07:00

2 lines
5.0 KiB
JavaScript

import{d as V,a as X}from"./KeyboardArrowRight.aa71047a.js";import{r as Y,i as J,a as Q}from"./jsx-runtime_commonjs-proxy.a0db3bf1.js";import{ap as U,u as Z,au as c,r as w,X as R,f as e,j as i,C as ee,T as S,av as te,aw as P,ax as T,ay as C,az as _,aA as M,$ as A,P as ae,g as le,aB as ne,B as ie,Y as re}from"./index.ef35a7e7.js";import{P as se}from"./Page.aa656a85.js";import{G as o}from"./Grid.ba6e5a37.js";import{C as ce}from"./Card.cc6fb9c1.js";import{T as de}from"./TableContainer.d3d72d8f.js";import{T as D,a as h,b as s,c as t}from"./TableRow.e3e9b73a.js";import{T as ue}from"./TableHead.24984064.js";var m={},oe=J.exports;Object.defineProperty(m,"__esModule",{value:!0});var y=m.default=void 0,he=oe(Y()),me=Q,pe=(0,he.default)((0,me.jsx)("path",{d:"M5 4v2h14V4H5zm0 10h4v6h6v-6h4l-7-7-7 7z"}),"Publish");y=m.default=pe;function Ce(){const{themeStretch:L}=U();Z();function N(a){return{...a,history:[{date:"2020-01-05",customerId:"11091700",amount:3},{date:"2020-01-02",customerId:"Anonymous",amount:1}]}}function B(a){const{row:l}=a,[d,K]=c.useState(!1);return i(c.Fragment,{children:[i(s,{sx:{"& > *":{borderBottom:"unset"}},children:[e(t,{children:e(le,{"aria-label":"expand row",size:"small",onClick:()=>K(!d),children:d?e(V,{}):e(X,{})})}),e(t,{align:"left",children:l.code}),e(t,{align:"left",children:l.name}),e(t,{align:"right",children:l.nik}),e(t,{align:"right",children:l.plan_code}),e(t,{align:"right",children:l.number_of_claim}),e(t,{align:"right",children:l.number_of_families}),e(t,{align:"right",children:e(A,{variant:"outlined",color:"success",size:"small",children:"Active"})})]}),e(s,{children:e(t,{style:{paddingBottom:0,paddingTop:0},colSpan:6,children:e(ne,{in:d,timeout:"auto",unmountOnExit:!0,children:i(ie,{sx:{margin:1},children:[e(S,{variant:"h6",gutterBottom:!0,component:"div",children:"History"}),i(D,{size:"small","aria-label":"purchases",children:[e(ue,{children:i(s,{children:[e(t,{children:"Date"}),e(t,{children:"Customer"}),e(t,{align:"right",children:"Amount"}),e(t,{align:"right",children:"Total price ($)"})]})}),e(h,{children:l.history?l.history.map(n=>i(s,{children:[e(t,{component:"th",scope:"row",children:n==null?void 0:n.date}),e(t,{children:n==null?void 0:n.customerId}),e(t,{align:"right",children:n==null?void 0:n.amount}),e(t,{align:"right",children:Math.round((n==null?void 0:n.amount)*1e3*100)/100})]},n==null?void 0:n.date)):e(s,{children:e(t,{colSpan:8,children:"No Data"})})})]})]})})})})]})}const[F,p]=c.useState(!0),[g,j]=c.useState([]),z=async()=>{p(!0);const a=await re.get("/members");p(!1),j(a.data.map(N))};w.exports.useEffect(()=>{z()},[]);const r={fontWeight:"bold"},H=48,O=8,f={PaperProps:{style:{maxHeight:H*4.5+O,width:250}}},$=["PLAN001","PLAN002","PLAN003","PLAN004","PLAN005"];function b(a,l,d){return{fontWeight:l.indexOf(a)===-1?d.typography.fontWeightRegular:d.typography.fontWeightMedium}}const v=R(),[x,E]=c.useState([]),W=a=>{const{target:{value:l}}=a;E(typeof l=="string"?l.split(","):l)},[I,k]=c.useState([]),q=a=>{const{target:{value:l}}=a;k(typeof l=="string"?l.split(","):l)},u=c.useRef(null),G=a=>{u!=null&&u.current?u.current.click():alert("No file selected")};return e(se,{title:"Member List",children:i(ee,{maxWidth:L?!1:"xl",children:[e(S,{variant:"h3",component:"h1",paragraph:!0,children:"Member List"}),i(o,{container:!0,spacing:2,sx:{mb:2},justifyContent:"flex-end",children:[e(o,{item:!0,children:e(te,{id:"outlined-basic",label:"Search",variant:"outlined",sx:{width:400}})}),e(o,{item:!0,children:i(P,{sx:{width:200},children:[e(T,{id:"plan-id-label",children:"PlanID"}),e(C,{labelId:"plan-id-label",id:"plan-id",multiple:!0,value:x,onChange:W,input:e(_,{label:"PlanID"}),MenuProps:f,children:$.map(a=>e(M,{value:a,style:b(a,x,v),children:a},a))})]})}),e(o,{item:!0,children:i(P,{sx:{width:200},children:[e(T,{id:"status-filter-label",children:"Status"}),e(C,{labelId:"status-filter-label",id:"status-filter",multiple:!0,value:I,onChange:q,input:e(_,{label:"Status"}),MenuProps:f,children:["Active","Suspended"].map(a=>e(M,{value:a,style:b(a,I,v),children:a},a))})]})}),i(o,{item:!0,children:[e("input",{id:"importMember",ref:u,style:{display:"none"},type:"file",accept:".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/plain"}),e(A,{variant:"outlined",startIcon:e(y,{}),sx:{p:1.8},onClick:G,children:"Import"})]})]}),e(ce,{children:e(de,{component:ae,children:i(D,{"aria-label":"collapsible table",children:[e(h,{children:i(s,{children:[e(t,{style:r,align:"left",children:"Detail"}),e(t,{style:r,align:"left",children:"MemberID"}),e(t,{style:r,align:"left",children:"Name"}),e(t,{style:r,align:"right",children:"NIK"}),e(t,{style:r,align:"right",children:"PlanID"}),e(t,{style:r,align:"right",children:"Claim\xA0(time)"}),e(t,{style:r,align:"right",children:"Family\xA0(person)"}),e(t,{style:r,align:"right",children:"Status"})]})}),F?e(h,{children:e(s,{children:e(t,{colSpan:8,align:"center",children:"Loading"})})}):g.length==0?e(h,{children:e(s,{children:e(t,{colSpan:8,align:"center",children:"No Data"})})}):e(h,{children:g.map(a=>e(B,{row:a},a.code))})]})})})]})})}export{Ce as default};