import{j as e,q as o,J as p}from"./app-Bup04Qnx.js";import{A as v}from"./AuthenticatedLayout-BdDF4YYO.js";import{T as g}from"./Table-B-yOTLCP.js";import{D as y,R as D}from"./RestoreModal-DxRPbH67.js";import{M as d}from"./WithModal-CbKxT3eW.js";import{u as F}from"./format-CisCU4Rs.js";import{D as S,a as T}from"./DetailModalContent-BPB3mCJa.js";import{u as A,s as C}from"./index-Dy_g3AZ5.js";import"./index-DdNKWgRS.js";import"./clsx-B-dksMZM.js";import"./index-CtjruoRR.js";import"./floating-ui.dom-CwWDmSD9.js";import"./Select-Cs0aMrtU.js";import"./BaseForm-wkPKZ5Eg.js";import"./table-2-B1MKhBGJ.js";import"./DetailModalItem-BOaAAJ7m.js";function s(i){return e.jsx(v,{title:i==null?void 0:i.title,children:e.jsx(f,{})})}const f=i=>{var u,m,h,x;let{tableHeader:r=null}=i;const{props:l}=o();r||(r=j());const c=_(),[a,k]=A(C),n=t=>{k(t)};return e.jsxs(e.Fragment,{children:[e.jsx(g,{search:!0,filter:!0,filterOptions:c,tableHeader:r,tableBody:((m=l==null?void 0:l[(u=l==null?void 0:l.page)==null?void 0:u.name])==null?void 0:m.data)??[],tablePage:(x=l==null?void 0:l[(h=l==null?void 0:l.page)==null?void 0:h.name])==null?void 0:x.links,tableAction:t=>{var b;return e.jsxs(e.Fragment,{children:[e.jsx("li",{children:e.jsx(d,{id:`detail_${t==null?void 0:t.id}`,onClick:()=>n(t),children:e.jsx("span",{children:"Lihat Selengkapnya"})})}),t.deleted_at?e.jsx("li",{children:e.jsx(d,{id:`modal_restore_${t==null?void 0:t.id}`,onClick:()=>n(t),children:"Pulihkan Data"})}):e.jsx("li",{children:e.jsx(p,{href:`${(b=l==null?void 0:l.page)==null?void 0:b.url}/${t.id}/edit`,className:"",children:"Edit"})}),e.jsx("li",{children:e.jsxs(d,{id:`modal_delete_${t==null?void 0:t.id}`,onClick:()=>n(t),children:["Hapus ",t.deleted_at?"Permanen":""]})})]})},...i}),a?e.jsxs(e.Fragment,{children:[e.jsx(y,{id:a==null?void 0:a.id,label:a.name,isForceDelete:a.deleted_at!=null,handleClick:()=>n(null)}),e.jsx(D,{id:a==null?void 0:a.id,label:a.name,handleClick:()=>n(null)}),e.jsx(S,{id:a==null?void 0:a.id,tableHeader:r,data:a,handleClick:()=>n(null),content:t=>T(t,r),size:"max-w-2xl"})]}):null]})},j=()=>{const{page:i,isAdmin:r}=o().props,{params:l}=F(location);return[{label:"#",value:"id",type:"numbering"},{label:"Kode Bank",value:"code",isSearchable:!0},{label:"Nama Bank",value:"name",isSearchable:!0},{label:"BI Fast",value:"bi_fast",custom:({data:a})=>e.jsx("td",{children:e.jsx("i",{className:`fas text-xl ${a.bi_fast?"fa-circle-check text-green-700":"fa-circle-xmark text-red-700"}`})})},{label:"Limit Transfer",value:"limit_transfer_amount",type:"currency",isHidden:!0},{label:"Status",value:"status",type:"status"},{label:"Dibuat",value:"created_at",isSearchable:!0,type:"date"},{label:"Terakhir Diperbarui",value:"updated_at",isSearchable:!0,type:"date"},{label:"Dihapus",value:"deleted_at",type:"date",isHidden:l.get("deleted_at")!="show"},{label:"Aksi",value:"id",type:"action"}]},_=()=>{const{props:i}=o();return[{name:"status",data:(i==null?void 0:i.status)??[],label:"Filter Status"},{name:"deleted_at",label:"Filter Data Terhapus"}]},H=({children:i})=>{const r=j();return i(r)},M=({children:i})=>{const r=_();return i(r)};s.Table=f;s.HeaderProvider=H;s.FilterProvider=M;const U=s;export{U as default};
