import{r as c,j as e}from"./login-aN2dRsX6.js";import{D as g}from"./DataTable-D2rA17vR.js";import{P as b}from"./page_header-wdV8ucix.js";import{S as x}from"./SelectProdukTabungan-2_58_DnQ.js";import{v as f,p as h}from"./query-c3dDncii.js";import{L as j}from"./app-gmlkJjeD.js";import{useModalDetailTabungan as k}from"./modalDetailTabungan-BpW8q3XP.js";import{C as v}from"./circle-plus-D9wc3WnO.js";import{E as T}from"./eye-By1xm0Dd.js";import"./search-4uBqei5W.js";import"./createLucideIcon-C44k9nIN.js";import"./delete-PVCdpT-9.js";import"./Select-B6FG_hRH.js";import"./defineProperty-DRmM3rRU.js";import"./typeof-QjJsDpFa.js";import"./setPrototypeOf-B4fUID9J.js";import"./index-Ci65TyJp.js";import"./floating-ui.dom-C5vApqfE.js";import"./alert-CsXKWu2a.js";import"./button_submit-wN0ayemz.js";import"./ThemeProvider-Cx_yflmw.js";import"./modalBrowseAnggota-oa-8B_hk.js";import"./Modal-Dn58D0E5.js";import"./react-number-format.es-iP3AzcWx.js";import"./x-CZwmhdFm.js";import"./save-CB8xeERj.js";function V(){var o,s;const n=f(),l=[{label:e.jsx("center",{children:"Rekening"}),width:120,align:"center",value:a=>a.rekening},{label:e.jsx("center",{children:"Produk"}),align:"center",width:200,value:a=>{var t;return(t=a.produk)==null?void 0:t.nama}},{label:"Nama Anggota",value:a=>{var t;return(t=a.anggota)==null?void 0:t.nama_lengkap}},{label:"Alamat",value:a=>{var t;return(t=a.anggota)==null?void 0:t.alamat}},{label:e.jsx("center",{}),width:80,align:"center",value:a=>e.jsx(j,{to:`/app/master/tabungan/${a.rekening}`,className:"c-pointer",children:e.jsx(T,{size:18})})}],[r,p]=c.useState(void 0),u=h(),i=k({onSubmit:async()=>(await n.refetch(),!0)});return e.jsxs("div",{className:"container",children:[e.jsx(b,{title:"Data Tabungan",breadcrumb:[{title:"Master",path:"/app/master"},{title:"Tabungan",path:"/app/master/tabungan"}]}),e.jsx(g,{data:((o=n.data)==null?void 0:o.filter(a=>{var t;return r?((t=a.produk)==null?void 0:t.id)===r.id:!0}))??[],column:l,search:!0,pagination:!0,loading:n.isLoading,item_per_page:15,buttons:e.jsxs("div",{className:"d-flex gap-2 align-items-center",children:[e.jsx("div",{style:{width:300},children:e.jsx(x,{value:(s=r==null?void 0:r.id)==null?void 0:s.toString(),onChange:a=>{var m;const t=(m=u.data)==null?void 0:m.find(d=>d.id==parseInt(a));p(t)}})}),e.jsxs("button",{className:"btn btn-primary d-flex gap-2 align-items-center",onClick:()=>i.open(),children:[e.jsx(v,{size:18}),"Tambah Tabungan"]})]})}),i.modal]})}export{V as default};
