import{r as o,j as a}from"./login-aN2dRsX6.js";import{S as x}from"./Select-B6FG_hRH.js";import{a as g}from"./index-B595qSOc.js";import{b}from"./index-26bvdVY4.js";import{c as j}from"./query-c3dDncii.js";import{D as p}from"./DataTable-D2rA17vR.js";import{M as m}from"./Modal-Dn58D0E5.js";const _=t=>{const[l,r]=o.useState(g.find(s=>s.value===t.value)??"");return a.jsx(x,{value:l,isDisabled:t.disable,options:g,placeholder:"Transaksi Deposito",onChange:s=>{var u;const n=s;r(n),(u=t.onChange)==null||u.call(t,n==null?void 0:n.value)}})},T=({onSelected:t})=>{const[l,r]=o.useState(!1),[s,n]=o.useState(1),u=e=>{n(e),r(!0)},c=()=>{r(!1)},h=o.useMemo(()=>[{label:a.jsx("center",{children:"Rekening"}),width:120,align:"center",value:e=>e.rekening},{label:"Nama Anggota",value:e=>{var i;return(i=e.anggota)==null?void 0:i.nama_lengkap}},{label:a.jsx("center",{children:"JKW"}),width:80,align:"center",value:e=>e.jkw},{label:a.jsx("center",{children:"Bunga"}),width:80,align:"center",value:e=>{var i;return(i=e.produk)==null?void 0:i.suku_bunga}},{label:a.jsx("center",{children:"Nominal"}),width:150,align:"right",value:e=>b(e.nilai_valuta)},{label:a.jsx("center",{}),width:80,align:"center",value:e=>a.jsx("span",{className:"badge text-bg-primary c-pointer",onClick:()=>{c(),t==null||t(e)},children:"Pilih"})}],[t]),d=j();return{modal:o.useMemo(()=>a.jsxs(m,{show:l,onHide:c,size:"xl",children:[a.jsx(m.Header,{closeButton:!0,children:a.jsx("h5",{className:"m-0",children:"Daftar Deposito"})}),a.jsx(m.Body,{children:a.jsx(p,{data:(d.data??[]).filter(e=>e.status==s),column:h,search:!0,pagination:!0,item_per_page:10,loading:d.isLoading})}),a.jsx(m.Footer,{children:a.jsx("button",{className:"btn btn-primary",onClick:c,children:"Tutup"})})]}),[l,d.data,d.isLoading,h,s]),open:u,close:c}};export{_ as S,T as u};
