PageSourceSearch

https://app.transactpay.ai/assets/chargeback-C0Gzp8DH.js

js transactpay.ai collected 2026-10-05 02:52:55 UTC 6,629 bytes, 1 lines download raw bytes

1import{h as q,d as H,r as n,a as $,j as a,b as y,a0 as m,B as M,P as O,s as V,v as D,Q}from"./index-BiwlBLjf.js";import{D as W}from"./index-Cz-2r8Tk.js";import{F as Y}from"./filter-header-BbsrRMkg.js";import{S as G}from"./status-badge-CfP1lEp8.js";import{C as F}from"./card-BPqi3BI-.js";import{B as _}from"./index-CUKXpqXH.js";import"./select-CQTcdMSk.js";import"./index-lfcKBI-N.js";import"./index-BvvUz0nn.js";import"./export-button-BthmD-p-.js";import"./exportToExcel-CfVF9nni.js";import"./chevron-left-D9oNKs06.js";import"./chevron-right-BKZhVBu-.js";const ie=()=>{var w,C,k,S,N,E,R;const{setHeader:P}=q(),T=H(),[h,x]=n.useState(1),[g,I]=n.useState(10),[c,p]=n.useState(""),[l,f]=n.useState(""),[i,b]=n.useState(""),[d,v]=n.useState(""),[u,j]=n.useState(""),B=e=>{const s=new Date,o=new Date;o.setDate(s.getDate()-e),p(o.toISOString().split("T")[0]),f(s.toISOString().split("T")[0])},K=()=>{p(""),f(""),b(""),v(""),j("")},{data:r}=$({queryKey:["CHARGEBACK_OVERVIEW",c,l,i,d],queryFn:async()=>{var s;const e=await y.get("/subsidiary/dashboard/chargeback/overview");return(s=e==null?void 0:e.data)==null?void 0:s.data}}),{data:t}=$({queryKey:["SETTLEMENTS",h,g,d,u,i,c,l],queryFn:async()=>{const e=await y.get(`/subsidiary/dashboard/chargeback/all?status=${i}&reference=${d}&customeremail=${u}&page=${h}&size=${g}&fromdate=${c?m(c,0,0,0):""}&todate=${l?m(l,23,59,59):""}`);return e==null?void 0:e.data}}),L=[{accessorKey:"dueDate",header:"Due Date",cell:({getValue:e})=>Q(e(),"dd-MM-yyyy")||"-"},{accessorKey:"customerEmail",header:"Customer Email",cell:({getValue:e})=>e()||"-"},{accessorKey:"amount",header:"Transaction Amount",cell:({row:e})=>{const s=e.original.amount,o=e.original.currency;return s!=null?a.jsxs(a.Fragment,{children:[o," ",s.toLocaleString()]}):"-"}},{accessorKey:"rrn",header:"RRN",cell:({getValue:e})=>e()||"-"},{accessorKey:"transactionReference",header:"Transaction Reference",cell:({getValue:e})=>e()||"-"},{accessorKey:"status",header:"Status",cell:({row:e})=>{const s=e.original.status;return s?a.jsx(G,{status:s}):"-"}}],A=[{name:"date",type:"date",value:"Date",options:[{label:"Last 7 days",value:"7"},{label:"Last 30 days",value:"30"},{label:"Last 90 days",value:"90"},{label:"Last 1 year",value:"365"}],onChange:e=>{if(typeof e=="string"){const s=parseInt(e,10);isNaN(s)||B(s)}else p(e.from),f(e.to)}},{name:"status",type:"select",placeholder:"Status",value:i,options:[{label:"Won",value:"won"},{label:"Lost",value:"lost"},{label:"New",value:"new"},{label:"Pending",value:"pending"},{label:"Awaiting Response",value:"awaiting Response"},{label:"Assessment",value:"assessment"},{label:"Accepted",value:"accepted"}],onChange:e=>{typeof e=="string"&&b(e)}},{name:"paymentReference",value:d,type:"text",placeholder:"Payment Reference",onChange:e=>{typeof e=="string"&&v(e)}},{name:"customerEmail",value:u,type:"text",placeholder:"Customer Email",onChange:e=>{typeof e=="string"&&j(e)}}];n.useEffect(()=>{var e,s;P("Chargeback",((s=(e=t==null?void 0:t.data)==null?void 0:e.page)==null?void 0:s.total)??0)},[t]);const z=[{Icon:"/assets/icons/battery-bar 1.svg",name:"Remaining of your threshold",value:(w=r==null?void 0:r.overview)==null?void 0:w.thresholdPercent,description:"How much room you have left before reaching the maximum allowed chargeback percentage (or count) set."},{Icon:"/assets/icons/back.svg",name:"Chargeback value",value:(C=r==null?void 0:r.overview)==null?void 0:C.chargebackValue,description:"The total monetary amount of all chargebacks filed against your account over a specific period.."},{Icon:"/assets/icons/stopwatch.svg",name:"Chargeback count",value:(k=r==null?void 0:r.overview)==null?void 0:k.chargebackCount,description:"The total number of chargebacks filed against your transactions within a specific period"},{Icon:"/assets/icons/high-signal 1.svg",name:"Chargeback ratio",value:"-",description:"Chargeback Percentage refers to the percentage of your total transactions that resulted in chargebacks."}];return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"border-b",children:a.jsx(Y,{filters:A,customButton:a.jsx(M,{onClick:K,children:"Reset Filters"}),exportButton:{fileName:"chargeback",exportType:"xlsx",disabled:!1,fetchFullData:async()=>{var s,o;const e=await y.get(`/subsidiary/dashboard/chargeback/all?export=true&status=${i}&reference=${d}&customeremail=${u}&page=${h}&size=${g}&fromdate=${c?m(c,0,0,0):""}&todate=${l?m(l,23,59,59):""}`);return(o=(s=e==null?void 0:e.data)==null?void 0:s.data)==null?void 0:o.items}}})}),a.jsx("div",{className:"p-4",children:t&&((N=(S=t==null?void 0:t.data)==null?void 0:S.items)==null?void 0:N.length)>0?a.jsxs("div",{className:"flex flex-col space-y-4",children:[a.jsx(F,{className:"flex h-auto w-full max-w-none flex-col justify-between space-y-3 rounded-none border p-1 shadow-none",children:a.jsx("div",{className:"flex w-full flex-col md:h-40 md:flex-row",children:z.map((e,s)=>a.jsxs("div",{className:`flex h-full w-full flex-col items-start justify-evenly space-y-3 px-4 py-3 md:min-w-44 ${s!==0?"border-gray-300 md:border-l":""}`,children:[a.jsx("div",{className:"border-primary flex h-10 w-10 items-center justify-center rounded-lg border bg-[#FBE9EF99] p-1",children:a.jsx("img",{src:e==null?void 0:e.Icon,alt:"icon",className:"h-7 w-7"})}),a.jsxs("div",{className:"flex w-full items-center justify-between",children:[a.jsx("span",{children:e==null?void 0:e.name}),a.jsxs(O,{children:[a.jsx(V,{asChild:!0,children:a.jsxs("button",{type:"button",className:"text-primary hover:text-primary/50 flex cursor-pointer items-center gap-0.5 text-xs font-medium",children:[a.jsx("span",{})," ",a.jsx(_,{})]})}),a.jsx(D,{children:a.jsx("p",{className:"text-left",children:e==null?void 0:e.description})})]})]}),a.jsx("h6",{children:e==null?void 0:e.value})]},s))})}),a.jsx(W,{columns:L,data:(E=t==null?void 0:t.data)==null?void 0:E.items,paginationMeta:(R=t==null?void 0:t.data)==null?void 0:R.page,onPageChange:e=>x(e),onPageSizeChange:e=>{I(e),x(1)},onRowClick:e=>
1{T(`chargeback-details/${e==null?void 0:e.id}`)}})]}):a.jsxs(F,{className:"flex min-h-60 flex-col items-center justify-center rounded-none shadow-none",children:[a.jsx("div",{className:"border-primary flex h-10 w-10 items-center justify-center rounded-lg border bg-[#FBE9EF99] p-1",children:a.jsx("img",{src:"/assets/icons/back.svg",alt:"icon",className:"h-7 w-7"})}),a.jsx("h4",{children:"You do not have any Chargebacks to Process"}),a.jsx("p",{className:"sm:max-w-4/6 text-center",children:"You do not have any chargebacks to process at the moment, monitor transactions regularly to stay informed on disputes."})]})})]})};export{ie as default};

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.