PageSourceSearch

https://console.quidkey.com/assets/refund-account-BxhWmFWZ.js

js quidkey.com collected 2026-09-24 13:40:58 UTC 4,328 bytes, 1 lines download raw bytes

1import{k as u,o as v,p as b,q as y,j as e,c as A,b as P,bh as C,bi as E,bj as _,bk as Q,bl as T,bm as F,bn as M,a as V,ax as B,r as h,ay as I,a3 as f,a4 as x,a5 as g,a6 as j,a7 as p}from"./main-To_L_1y0.js";function N({account:t,inline:n}){return e.jsx(C,{label:"Refund balance",balance:t.balance,currency:t.currency,environment:t.environment,inline:n,action:e.jsx(E,{account:t,size:n?"sm":"default"})})}function k({account:t,merchantId:n}){const r=_(n);return e.jsx(Q,{description:"Money coming in and going out of the refund account.",environment:t.environment,noAccountLabel:"No refund account configured",source:{queryKey:["bank-accounts",t.id,"transactions"],fetchPage:s=>F(t.id,s),buildExportUrl:s=>T(t.id,s),exportFilePrefix:"refund-activity",transactionLink:r}})}function z(){const{currentContext:t}=P(),n=t?.type==="merchant"?t.id:void 0;return n?e.jsx(O,{merchantId:n}):e.jsx(U,{})}function O({merchantId:t,compact:n=!1}){const r=u({...v(t),enabled:!0}),s=b(y.RefundAccountActivity);return e.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n?e.jsx("h2",{className:"shrink-0 text-lg font-semibold tracking-tight",children:"Refund Account"}):e.jsxs("div",{className:"shrink-0",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Refund Account"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"View refund account balance and top-up details."})]}),r.isLoading?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mt-8",children:[e.jsx(A,{className:"h-4 w-4 animate-spin"}),"Loading refund account..."]}):r.data?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"shrink-0 mt-8",children:e.jsx(N,{account:r.data})}),s?e.jsx("div",{className:"flex-1 min-h-0 mt-8",children:e.jsx(k,{account:r.data,merchantId:t})}):null]}):e.jsx("p",{className:"text-sm text-muted-foreground mt-8",children:"No refund account found."})]})}function U(){const t=M.useSearch(),{partner_id:n,merchant_id:r}=t,s=V(),L=b(y.RefundAccountActivity),i=u(B()),o=Array.isArray(i.data)?i.data:[];h.useEffect(()=>{if(n||i.isLoading||i.isError||o.length===0)return;const m=o.find(S=>S.name?.toLowerCase()==="merchant portal")??o[0];m?.id&&s({to:"/refund-account",search:{partner_id:m.id,merchant_id:void 0},replace:!0})},[n,i.isLoading,i.isError,i.data,s]);const c=u({...I(n),enabled:!!n}),l=Array.isArray(c.data)?c.data:[];h.useEffect(()=>{if(r||!n||c.isLoading||c.isError||l.length===0)return;const a=l[0];a?.id&&s({to:"/refund-account",search:{partner_id:n,merchant_id:a.id},replace:!0})},[r,n,c.isLoading,c.isError,c.data,s]);const d=u({...v(r??""),enabled:!!r}),R=a=>{s({to:"/refund-account",search:{partner_id:a,merchant_id:void 0}})},w=a=>{s({to:"/refund-account",search:{partner_id:n,merchant_id:a}})};return e.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[e.jsxs("div",{className:"shrink-0",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Refund Account"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"View refund account balance and top-up details."})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 shrink-0 mt-4",children:[e.jsxs(f,{value:n??"",onValueChange:R,children:[e.jsx(x,{className:"w-[220px]",children:e.jsx(g,{placeholder:"Select partner"})}),e.jsx(j,{children:o.map(a=>e.jsx(p,{value:a.id,children:a.name??a.id},a.id))})]}),e.jsxs(f,{value:r??"",onValueChange:w,disabled:!n||c.isLoading,children:[e.jsx(x,{className:"w-[280px]",children:e.jsx(g,{placeholder:"Select merchant"})}),e.jsx(j,{children:l.map(a=>e.jsx(p,{value:a.id,children:a.brand_name??a.id},a.id))})]}),d.data?e.jsx("div",{className:"ml-auto",children:e.jsx(N,{account:d.data,inline:!0})}):null]}),r?d.isLoading?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mt-8",children:[e.jsx(A,{className:"h-4 w-4 animate-spin"}),"Loading refund account..."]}):d.data?L?e.jsx("div",{className:"flex-1 min-h-0 mt-8",children:e.jsx(k,{account:d.data,merchantId:r??""})}):null:e.jsx("p",{className:"text-sm text-muted-foreground mt-8",children:"No refund account found for this merchant."}):e.jsx("p",{className:"text-sm text-muted-foreground mt-8",children:"Select a merchant to view their refund account."})]})}
1export{O as MerchantRefundAccountPage,z as component};

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.