import{H as E}from"./HeaderBreadcrumbs.da67f38c.js";import{P as q}from"./Page.4c1db0aa.js";import{d as k,a as O}from"./KeyboardArrowRight.3ee3e2fb.js";import{d as $}from"./Add.06de942b.js";import{aQ as z,r as i,a as M,j as s,f as e,ar as S,S as N,aq as F,az as H,as as W,g as A,aj as Q,ay as G,B as J,T as K}from"./index.8f299a7d.js";import{L as U,a as V}from"./LaravelTable.8fef90a3.js";import{r as X,i as Y,a as Z}from"./jsx-runtime_commonjs-proxy.e03e6edd.js";import{C as ee}from"./Card.1ec83a31.js";import{T as ae,a as g,b as u,c as a}from"./TableRow.d2ef76cd.js";import"./BasePagination.56fc59df.js";import"./TableContainer.b8d5000e.js";var v={},te=Y.exports;Object.defineProperty(v,"__esModule",{value:!0});var _=v.default=void 0,ne=te(X()),re=Z,le=(0,ne.default)((0,re.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");_=v.default=le;function ie(){const[c,T]=z();i.exports.useState(null);const y=M();function B(n){const t=i.exports.useRef(null),[r,h]=i.exports.useState(""),f=l=>{var d;const p=(d=l.target.value)!=null?d:"";h(p)},m=l=>{l.preventDefault(),n.onSearch({search:r})};return i.exports.useEffect(()=>{var l;h((l=c.get("search"))!=null?l:"")},[]),e("form",{onSubmit:m,style:{width:"100%"},children:e(W,{id:"search-input",ref:t,label:"Search",variant:"outlined",fullWidth:!0,onChange:f,value:r})})}function R(n){return S.useState(null),i.exports.useRef(null),i.exports.useState(null),e("div",{children:s(N,{direction:"row",spacing:2,sx:{p:2},children:[e(B,{onSearch:j}),e(F,{variant:"outlined",startIcon:e($,{}),sx:{p:1.8},onClick:()=>{y("/claims/create")},children:"Create"})]})})}const[C,D]=i.exports.useState(!0),[b,L]=i.exports.useState(U),x=async(n=null)=>{D(!0);const t=n||Object.fromEntries([...c.entries()]),r=await H.get("/claims",{params:t});D(!1),L(r.data)},j=async n=>{await x(n),T(n)},P=(n,t)=>{const r=Object.fromEntries([...c.entries(),["page",t]]);x(r),T(r)};i.exports.useEffect(()=>{x()},[]);const o={fontWeight:"bold"};function w(n){var f,m,l,p,d;const{row:t}=n,[r,h]=S.useState(!1);return s(S.Fragment,{children:[s(u,{sx:{"& > *":{borderBottom:"unset"}},children:[e(a,{children:e(A,{"aria-label":"expand row",size:"small",onClick:()=>h(!r),children:r?e(k,{}):e(O,{})})}),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:(m=t.plan)==null?void 0:m.code}),e(a,{align:"left",children:(l=t.benefit)==null?void 0:l.code}),s(a,{align:"left",children:["(",(p=t.diagnosis)==null?void 0:p.code,") ",(d=t.diagnosis)==null?void 0:d.name]}),e(a,{align:"left",children:Q(t.total_claim)}),e(a,{align:"right",children:e(_,{onClick:se=>{y("/claims/"+t.id)}})})]}),e(u,{children:e(a,{style:{paddingBottom:0,paddingTop:0},colSpan:99,children:e(G,{in:r,timeout:"auto",unmountOnExit:!0,children:e(J,{sx:{borderBottom:1},children:s(K,{variant:"body2",gutterBottom:!0,component:"div",children:["Description : ",t.description]})})})})})]})}function I(){return s(ae,{"aria-label":"collapsible table",children:[e(g,{children:s(u,{children:[e(a,{style:o,align:"left"}),e(a,{style:o,align:"left",children:"Code"}),e(a,{style:o,align:"left",children:"Member Name"}),e(a,{style:o,align:"left",children:"Plan"}),e(a,{style:o,align:"left",children:"Benefit"}),e(a,{style:o,align:"left",children:"Diagnosis"}),e(a,{style:o,align:"left",children:"Total Claim"}),e(a,{style:o,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 s(ee,{children:[e(R,{}),e(V,{isLoading:C,lastRequest:0,data:b,handlePageChange:P,TableContent:e(I,{})})]})}function Se(){const c="Claim";return s(q,{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};
