2 lines
4.9 KiB
JavaScript
2 lines
4.9 KiB
JavaScript
import{c as V,i as J,r as Q,T as U,a as S,b as o,d as s,e as t,f as X,g as Y}from"./KeyboardArrowRight.800c6a53.js";import{ak as Z,u as w,aq as c,r as R,ah as ee,f as e,j as i,C as te,T as P,ar as ae,as as T,at as C,au as _,av as M,aw as D,ap as A,P as le,g as ne,ax as ie,B as re,ay as se}from"./index.8dfdc9ed.js";import{P as ce}from"./Page.2c1cad43.js";import{G as h}from"./Grid.9e7e99d7.js";import{C as de}from"./Card.57605f6f.js";import{T as ue}from"./TableHead.4a10995a.js";var p={},oe=J.exports;Object.defineProperty(p,"__esModule",{value:!0});var y=p.default=void 0,he=oe(V),pe=Q,me=(0,he.default)((0,pe.jsx)("path",{d:"M5 4v2h14V4H5zm0 10h4v6h6v-6h4l-7-7-7 7z"}),"Publish");y=p.default=me;function Se(){const{themeStretch:L}=Z();w();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(ne,{"aria-label":"expand row",size:"small",onClick:()=>K(!d),children:d?e(X,{}):e(Y,{})})}),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(ie,{in:d,timeout:"auto",unmountOnExit:!0,children:i(re,{sx:{margin:1},children:[e(P,{variant:"h6",gutterBottom:!0,component:"div",children:"History"}),i(S,{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(o,{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,m]=c.useState(!0),[g,j]=c.useState([]),H=async()=>{m(!0);const a=await se.get("/members");m(!1),j(a.data.map(N))};R.exports.useEffect(()=>{H()},[]);const r={fontWeight:"bold"},O=48,k=8,f={PaperProps:{style:{maxHeight:O*4.5+k,width:250}}},z=["PLAN001","PLAN002","PLAN003","PLAN004","PLAN005"];function b(a,l,d){return{fontWeight:l.indexOf(a)===-1?d.typography.fontWeightRegular:d.typography.fontWeightMedium}}const v=ee(),[x,E]=c.useState([]),W=a=>{const{target:{value:l}}=a;E(typeof l=="string"?l.split(","):l)},[I,$]=c.useState([]),q=a=>{const{target:{value:l}}=a;$(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(ce,{title:"Member List",children:i(te,{maxWidth:L?!1:"xl",children:[e(P,{variant:"h3",component:"h1",paragraph:!0,children:"Member List"}),i(h,{container:!0,spacing:2,sx:{mb:2},justifyContent:"flex-end",children:[e(h,{item:!0,children:e(ae,{id:"outlined-basic",label:"Search",variant:"outlined",sx:{width:400}})}),e(h,{item:!0,children:i(T,{sx:{width:200},children:[e(C,{id:"plan-id-label",children:"PlanID"}),e(_,{labelId:"plan-id-label",id:"plan-id",multiple:!0,value:x,onChange:W,input:e(M,{label:"PlanID"}),MenuProps:f,children:z.map(a=>e(D,{value:a,style:b(a,x,v),children:a},a))})]})}),e(h,{item:!0,children:i(T,{sx:{width:200},children:[e(C,{id:"status-filter-label",children:"Status"}),e(_,{labelId:"status-filter-label",id:"status-filter",multiple:!0,value:I,onChange:q,input:e(M,{label:"Status"}),MenuProps:f,children:["Active","Suspended"].map(a=>e(D,{value:a,style:b(a,I,v),children:a},a))})]})}),i(h,{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(de,{children:e(U,{component:le,children:i(S,{"aria-label":"collapsible table",children:[e(o,{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(o,{children:e(s,{children:e(t,{colSpan:8,align:"center",children:"Loading"})})}):g.length==0?e(o,{children:e(s,{children:e(t,{colSpan:8,align:"center",children:"No Data"})})}):e(o,{children:g.map(a=>e(B,{row:a},a.code))})]})})})]})})}export{Se as default};
|