1import{r as g,D as h,e as f,j as e,M as p,b6 as I,bO as D,E as y,f as u,q as N,an as P}from"./index-1ZwnxBtP.js";import{B as v}from"./BootStrapTable-BGWd0CKh.js";import{P as T}from"./StateBasedPagination-GXnzMTTz.js";import{g as _}from"./Dashboard-Dq9NbOWA.js";import"./AffiliateSalesLineItemsModalNew-C90JqFvV.js";import"./useDebounce-DfXLfP9X.js";import"./Dropdown-Za-Ta5Bo.js";import"./ThemeProvider-DppOPtX1.js";import"./use-isomorphic-layout-effect.browser.esm-Dlv4p7Sx.js";import"./BackButton-gsucH3Mk.js";import"./index-v2WCNqB0.js";import"./RenderCommission-CAGJj7T-.js";import"./BootStrapPagedTable-Dx9C5Ed-.js";import"./StoreDiscountCouponAutoRedeem-Bo7Iw-zJ.js";const S=new Date;function W(){const[r,o]=g.useState(30),[l,d]=g.useState(0),{data:i,isLoading:m}=h("/transactions?limit=".concat(r,"&offset=").concat(l*r),f),x=(i==null?void 0:i.transactions)||[],t=i==null?void 0:i.count,[n,c]=g.useState(null),b=[{title:"Date",dataIndex:"created_at",render:a=>{const s=new Date(a);return e.jsxs("span",{className:"",children:[e.jsxs("span",{className:"mr-1 number",children:[e.jsx(D,{value:s,minute:"2-digit",hour12:!0,hour:"2-digit"}),","]}),e.jsx(y,{value:s,year:s.getFullYear()!==S.getFullYear()?"numeric":void 0,month:"short",day:"numeric"})]})}},{title:"Transaction",dataIndex:"metadata",render:(a,s)=>{const j=_(s.event_type,s.entity_type);if(j)return e.jsx(j,{metadata:a,entity_id:s.entity_id,onShowEventLog:()=>c(s.entity_id)});console.log("not found for ",s)}},{title:"Amount",dataIndex:"amount",type:"number",render:a=>e.jsx("span",{className:a>0?"text-success":"text-danger",children:e.jsx(u,{value:a})})},{title:"Final Balance",dataIndex:"endingBalance",type:"number",render:a=>e.jsx("span",{className:a>0?"":"text-danger",children:e.jsx(u,{value:a})})}];return e.jsxs(e.Fragment,{children:[e.jsx("h3",{children:e.jsx(p,{id:"Transactions"})}),e.jsx("div",{children:e.jsx(p,{id:"TransactionDescription"})}),e.jsx(F,{entity_id:n,onClose:()=>c(null)}),m?e.jsx(I,{count:3.4*r}):e.jsx(v,{loading:m,dataSource:x,columns:b}),t>0&&e.jsxs("div",{className:"d-flex mt-2 align-items-center justify-content-between",children:[e.jsx("span",{className:"mr-2",children:e.jsx(p,{id:"Page currentPageNumber of totalPages",defaultMessage:"Page {page, number} of {totalPages, number}",values:{page:l+1,totalPages:Math.ceil(t/r)}})}),e.jsx(T,{count:t,limit:r,page:l,setLimit:o,goToPage:d})]})]})}function F({affiliate_id:r,entity_id:o,onClose:l}){const{data:d,isLoading:i}=h(o?"/transactions/".concat(o):null,f),m=((d==null?void 0:d.transactions)||[]).sort((t,n)=>new Date(t.created_at).getTime()-new Date(n.created_at).getTime()),x=[{title:"Date",dataIndex:"created_at",render:(t,n)=>e.jsx("span",{children:e.jsx(y,{value:t,month:"short",hour:"numeric",hour12:!0,minute:"numeric",day:"2-digit",year:P(t).isSame(new Date,"year")?void 0:"numeric"})})},{title:"Transaction",dataIndex:"metadata",render:(t,n)=>{const c=_(n.event_type,n.entity_type);if(c)return e.jsx(c,{metadata:t,entity_id:n.entity_id});console.log("not found for ",n)}},{title:"Amount",dataIndex:"amount",render:t=>e.jsx("span",{className:t>0?"text-success":"text-danger",children:e.jsx(u,{value:t})})},{title:"Final Balance",dataIndex:"endingBalance",render:t=>e.jsx("span",{className:t>0?"":"text-danger",children:e.jsx(u,{value:t})})}];return e.jsx(N,{size:"lg",visible:o,onClose:l,title:"Event log",children:e.jsx(v,{loading:i,dataSource:m,columns:x})})}export{W as default}; 2//# sourceMappingURL=TransactionsIndex-kVkSafi0.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.