PageSourceSearch

https://app.refinal.ai/static/js/937.106c09f0.chunk.js

js refinal.ai collected 2026-10-05 14:42:46 UTC 8,784 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkrevolut_tracker_frontend=self.webpackChunkrevolut_tracker_frontend||[]).push([[937],{3937(e,t,s){s.r(t),s.d(t,{default:()=>o});var r=s(5043),a=s(1009),d=s(4385),l=s(8655),i=s(5719),c=s(579);const x=(e,t)=>null===e||void 0===e?"--":new Intl.NumberFormat("en-US",{style:"currency",currency:t||"USD",maximumFractionDigits:0}).format(e),n=e=>e?new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"--",o=()=>{const e=(0,l.dj)(),[t,s]=(0,r.useState)([]),[o,m]=(0,r.useState)(0),[h,b]=(0,r.useState)(!0),[k,j]=(0,r.useState)(""),[u,p]=(0,r.useState)(0),[f,y]=(0,r.useState)(null),[N,g]=(0,r.useState)(!1),w=(0,r.useCallback)(async()=>{b(!0);try{const e=await i.mJ.getCustomers({skip:25*u,limit:25,search:k||void 0,sort_by:"last_payment_at",sort_order:"desc"});s(e.customers),m(e.total_count)}catch(t){e.error("Failed to load customers")}finally{b(!1)}},[u,k,e]);(0,r.useEffect)(()=>{w()},[w]),(0,r.useEffect)(()=>{p(0)},[k]);const v=Math.ceil(o/25);if(f){const e=f;return(0,c.jsxs)("div",{className:"p-6",children:[(0,c.jsxs)("button",{onClick:()=>y(null),className:"flex items-center gap-2 text-primary mb-6 hover:underline",children:[(0,c.jsx)(a.kRp,{size:16})," Back to customers"]}),(0,c.jsxs)("div",{className:"rounded-lg border border-stroke bg-white dark:border-strokedark dark:bg-boxdark p-6 mb-6",children:[(0,c.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("h1",{className:"text-2xl font-semibold text-black dark:text-white",children:e.name||e.email||e.external_id}),e.email&&(0,c.jsxs)("p",{className:"text-body flex items-center gap-1 mt-1",children:[(0,c.jsx)(a.pHD,{size:14})," ",e.email]})]}),(0,c.jsx)(d.Ex,{variant:"info",children:e.source})]}),(0,c.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mt-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"text-xs text-body mb-1",children:"Country"}),(0,c.jsxs)("p",{className:"text-sm font-medium text-black dark:text-white flex items-center gap-1",children:[(0,c.jsx)(a.HzC,{size:12})," ",e.country||"--"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"text-xs text-body mb-1",children:"Registered"}),(0,c.jsxs)("p",{className:"text-sm font-medium text-black dark:text-white flex items-center gap-1",children:[(0,c.jsx)(a.wIk,{size:12})," ",n(e.registered_at)]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"text-xs text-body mb-1",children:"Total Payments"}),(0,c.jsx)("p",{className:"text-sm font-medium text-black dark:text-white",children:e.total_payments})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"text-xs text-body mb-1",children:"Total Amount"}),(0,c.jsxs)("p",{className:"text-sm font-medium text-black dark:text-white flex items-center gap-1",children:[(0,c.jsx)(a.z8N,{size:12})," ",x(e.total_amount,e.currency)]})]})]})]}),(0,c.jsx)("h2",{className:"text-lg font-semibold text-black dark:text-white mb-3",children:"Recent Payments"}),e.recent_payments&&e.recent_payments.length>0?(0,c.jsx)("div",{className:"rounded-lg border border-stroke bg-white dark:border-strokedark dark:bg-boxdark",children:(0,c.jsxs)("table",{className:"w-full",children:[(0,c.jsx)("thead",{children:(0,c.jsxs)("tr",{className:"border-b border-stroke dark:border-strokedark",children:[(0,c.jsx)("th",{className:"p-3 text-left text-xs font-semibold text-body",children:"Date"}),(0,c.jsx)("th",{className:"p-3 text-right text-xs font-semibold text-body",children:"Amount"}),(0,c.jsx)("th",{className:"p-3 text-left text-xs font-semibold text-body",children:"Method"}),(0,c.jsx)("th",{className:"p-3 text-left text-xs font-semibold text-body",children:"Status"}),(0,c.jsx)("th",{className:"p-3 text-left text-xs font-semibold text-body",children:"Description"})]})}),(0,c.jsx)("tbody",{children:e.recent_payments.map(e=>(0,c.jsxs)("tr",{className:"border-b border-stroke dark:border-strokedark last:border-0",children:[(0,c.jsx)("td",{className:"p-3 text-sm text-black dark:text-white",children:n(e.date)}),(0,c.jsx)("td",{className:"p-3 text-sm text-right font-medium text-black dark:text-white",children:x(e.amount,e.currency)}),(0,c.jsx)("td",{className:"p-3 text-sm text-body",children:e.payment_method||"--"}),(0,c.jsx)("td",{className:"p-3",children:(0,c.jsx)(d.Ex,{variant:"COMPLETED"===e.status?"success":"warning",size:"sm",children:e.status||"--"})}),(0,c.jsx)("td",{className:"p-3 text-sm text-body truncate max-w-[200px]",children:e.description||"--"})]},e.id))})]})}):(0,c.jsx)("p",{className:"text-body text-sm",children:"No payments found"})]})}return(0,c.jsxs)("div",{className:"p-6",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)("h1",{className:"text-2xl font-semibold text-black dark:text-white",children:"Customers"}),(0,c.jsxs)("p",{className:"text-sm text-body mt-1",children:[o," customers"]})]})}),(0,c.jsx)("div",{className:"flex items-center gap-3 mb-4",children:(0,c.jsx)("div",{className:"flex-1 max-w-xs",children:(0,c.jsx)(d.pd,{placeholder:"Search by name, email...",value:k,onChange:e=>j(e.target.value),icon:a.CKj})})}),h?(0,c.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,c.jsx)(d.y$,{size:"xl"})}):0===t.length?(0,c.jsxs)("div",{className:"flex flex-col items-center justify-center text-center h-48 rounded-lg border border-stroke bg-white p-6 dark:border-strokedark dark:bg-boxdark",children:[(0,c.jsx)(a.cfS,{size:40,className:"text-primary mb-4"}),(0,c.jsx)("h3",{className:"text-lg font-semibold text-black dark:text-white mb-2",children:k?"No customers found":"No Customers Yet"}),(0,c.jsx)("p",{className:"text-body max-w-sm",children:k?"Try adjusting your search":"Customers will appear after syncing your payment providers"})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"rounded-lg border border-stroke bg-white dark:border-strokedark dark:bg-boxdark",children:(0,c.jsxs)("table",{className:"w-full",children:[(0,c.jsx)("thead",{children:(0,c.jsxs)("tr",{className:"border-b border-stroke dark:border-strokedark",children:[(0,c.jsx)("th",{className:"p-4 text-left text-sm font-semibold text-black dark:text-white",children:"Customer"}),(0,c.jsx)("th",{className:"p-4 text-left text-sm font-semibold text-black dark:text-white",children:"Country"}),(0,c.jsx)("th",{className:"p-4 text-left text-sm font-semibold text-black dark:text-white",children:"Registered"}),(0,c.jsx)("th",{className:"p-4 text-right text-sm font-semibold text-black dark:text-white",children:"Payments"}),(0,c.jsx)("th",{className:"p-4 text-right text-sm font-semibold text-black dark:text-white",children:"Total Amount"}),(0,c.jsx)("th",{className:"p-4 text-left text-sm font-semibold text-black dark:text-white",children:"Last Payment"})]})}),(0,c.jsx)("tbody",{children:t.map(t=>(0,c.jsxs)("tr",{className:"border-b border-stroke dark:border-strokedark cursor-pointer hover:bg-gray-50 dark:hover:bg-meta-4 transition-colors",onClick:()=>(async t=>{g(!0);try{const e=await i.mJ.getCustomer(t.id);y(e)}catch(s){e.error("Failed to load customer details")}finally{g(!1)}})(t),children:[(0,c.jsxs)("td",{className:"p-4",children:[(0,c.jsx)("div",{className:"text-sm font-medium text-black dark:text-white",children:t.name||t.external_id}),t.email&&(0,c.jsx)("div",{className:"text-xs text-body",children:t.email})]}),(0,c.jsx)("td",{className:"p-4 text-sm text-body",children:t.country||"--"}),(0,c.jsx)("td",{className:"p-4 text-sm text-body",children:n(t.registered_at)}),(0,c.jsx)("td",{className:"p-4 text-sm text-right font-medium text-black dark:text-white",children:t.total_payments}),(0,c.jsx)("td",{className:"p-4 text-sm text-right font-medium text-black dark:text-white",children:x(t.total_amount,t.currency)}),(0,c.jsx)("td",{className:"p-4 text-sm text-body",children:n(t.last_payment_at)})]},t.id))})]})}),v>1&&(0,c.jsxs)("div",{className:"flex items-center justify-between mt-4",children:[(0,c.jsxs)("span",{className:"text-sm text-body",children:["Page ",u+1," of ",v]}),(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)("button",{onClick:()=>p(e=>Math.max(0,e-1)),disabled:0===u,className:"p-2 rounded border border-stroke dark:border-strokedark disabled:opacity-50 hover:bg-gray-50 dark:hover:bg-meta-4",children:(0,c.jsx)(a.irw,{size:16})}),(0,c.jsx)("button",{onClick:()=>p(e=>Math.min(v-1,e+1)),disabled:u>=v-1,className:"p-2 rounded border border-stroke dark:border-strokedark disabled:opacity-50 hover:bg-gray-50 dark:hover:bg-meta-4",children:(0,c.jsx)(a.fOo,{size:16})})]})]})]}),N&&(0,c.jsx)("div",{className:"fixed inset-0 bg-black/20 flex items-center justify-center z-50",children:(0,c.jsx)(d.y$,{size:"xl"})})]})}}}]);
2//# sourceMappingURL=937.106c09f0.chunk.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.