Files
aso/public/dashboard/assets/Index.bd6519a2.js
2023-02-15 10:47:39 +07:00

2 lines
4.2 KiB
JavaScript

import{H as E}from"./HeaderBreadcrumbs.91259cd4.js";import{P as $}from"./Page.c2cde06d.js";import{d as k,a as q}from"./KeyboardArrowRight.f797f999.js";import{d as O}from"./Add.abe475ec.js";import{a0 as M,r as s,a as z,j as o,f as e,au as S,S as N,$ as A,Y as F,av as H,g as W,an as Y,aB as G,B as J,T as K}from"./index.eaf14aef.js";import{L as Q,a as U}from"./LaravelTable.2b214f9b.js";import{r as V,i as X,a as Z}from"./jsx-runtime_commonjs-proxy.20d2a437.js";import{C as ee}from"./Card.4687a3ba.js";import{T as ae,a as g,b as u,c as a}from"./TableRow.9c0fd6dd.js";import"./BasePagination.48b4da63.js";import"./TableContainer.cdb185b9.js";var v={},te=X.exports;Object.defineProperty(v,"__esModule",{value:!0});var B=v.default=void 0,ne=te(V()),le=Z,re=(0,ne.default)((0,le.jsx)("path",{d:"M3 17.46v3.04c0 .28.22.5.5.5h3.04c.13 0 .26-.05.35-.15L17.81 9.94l-3.75-3.75L3.15 17.1c-.1.1-.15.22-.15.36zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"EditRounded");B=v.default=re;function ie(){const[c,T]=M();s.exports.useState(null);const y=z();function _(n){const t=s.exports.useRef(null),[l,h]=s.exports.useState(""),f=i=>{var d;const m=(d=i.target.value)!=null?d:"";h(m)},p=i=>{i.preventDefault(),n.onSearch({search:l})};return s.exports.useEffect(()=>{var i;h((i=c.get("search"))!=null?i:"")},[]),e("form",{onSubmit:p,style:{width:"100%"},children:e(H,{id:"search-input",ref:t,label:"Search",variant:"outlined",fullWidth:!0,onChange:f,value:l})})}function R(n){return S.useState(null),s.exports.useRef(null),s.exports.useState(null),e("div",{children:o(N,{direction:"row",spacing:2,sx:{p:2},children:[e(_,{onSearch:P}),e(A,{variant:"outlined",startIcon:e(O,{}),sx:{p:1.8},onClick:()=>{y("/claims/create")},children:"Create"})]})})}const[C,D]=s.exports.useState(!0),[b,L]=s.exports.useState(Q),x=async(n=null)=>{D(!0);const t=n||Object.fromEntries([...c.entries()]),l=await F.get("/claims",{params:t});D(!1),L(l.data)},P=async n=>{await x(n),T(n)},j=(n,t)=>{const l=Object.fromEntries([...c.entries(),["page",t]]);x(l),T(l)};s.exports.useEffect(()=>{x()},[]);const r={fontWeight:"bold"};function w(n){var f,p,i,m,d;const{row:t}=n,[l,h]=S.useState(!1);return o(S.Fragment,{children:[o(u,{sx:{"& > *":{borderBottom:"unset"}},children:[e(a,{children:e(W,{"aria-label":"expand row",size:"small",onClick:()=>h(!l),children:l?e(k,{}):e(q,{})})}),e(a,{align:"left",children:t.code}),e(a,{align:"left",children:(f=t.member)==null?void 0:f.full_name}),e(a,{align:"left",children:(p=t.plan)==null?void 0:p.code}),e(a,{align:"left",children:(i=t.benefit)==null?void 0:i.code}),o(a,{align:"left",children:["(",(m=t.diagnosis)==null?void 0:m.code,") ",(d=t.diagnosis)==null?void 0:d.name]}),e(a,{align:"left",children:Y(t.total_claim)}),t.status=="approved"&&e(a,{align:"left",children:"Approved"}),t.status=="postpone"&&e(a,{align:"left",children:"Postponed"}),e(a,{align:"right",children:e(B,{onClick:se=>{y("/claims/"+t.id)}})})]}),e(u,{children:e(a,{style:{paddingBottom:0,paddingTop:0},colSpan:99,children:e(G,{in:l,timeout:"auto",unmountOnExit:!0,children:e(J,{sx:{borderBottom:1},children:o(K,{variant:"body2",gutterBottom:!0,component:"div",children:["Description : ",t.description]})})})})})]})}function I(){return o(ae,{"aria-label":"collapsible table",children:[e(g,{children:o(u,{children:[e(a,{style:r,align:"left"}),e(a,{style:r,align:"left",children:"Code"}),e(a,{style:r,align:"left",children:"Member Name"}),e(a,{style:r,align:"left",children:"Plan"}),e(a,{style:r,align:"left",children:"Benefit"}),e(a,{style:r,align:"left",children:"Diagnosis"}),e(a,{style:r,align:"left",children:"Total Claim"}),e(a,{style:r,align:"left",children:"Status"}),e(a,{style:r,align:"right",children:"Action"})]})}),C?e(g,{children:e(u,{children:e(a,{colSpan:8,align:"center",children:"Loading"})})}):b.data.length===0?e(g,{children:e(u,{children:e(a,{colSpan:8,align:"center",children:"No Data"})})}):e(g,{children:b.data.map(n=>e(w,{row:n},n.id))})]})}return o(ee,{children:[e(R,{}),e(U,{isLoading:C,lastRequest:0,data:b,handlePageChange:j,TableContent:e(I,{})})]})}function Se(){const c="Claim";return o($,{title:c,sx:{mx:2},children:[e(E,{heading:c,links:[{name:"Dashboard",href:"/dashboard"},{name:"Claim",href:"/claims"}]}),e(ie,{})]})}export{Se as default};