1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[31690],{11870:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var a=r(37876),s=r(14232),l=r(62842),d=r(53403);let n=["sa","uae"],i=[{key:"created",header:"Created",render:e=>e.dateCreated?(0,a.jsx)("span",{className:"text-xs text-gray-700 whitespace-nowrap",children:(0,l.v7)(e.dateCreated)}):"â",sortBy:e=>e.dateCreated?new Date(e.dateCreated).getTime():0},{key:"customer",header:"Customer",render:e=>(0,a.jsxs)("div",{className:"leading-tight",children:[(0,a.jsx)("div",{className:"font-medium text-gray-900",children:e.fullName||"â"}),(0,a.jsxs)("div",{className:"text-xs text-gray-400 font-mono",children:[e.customerId.slice(0,12),"â¦"]})]}),sortBy:e=>{var t;return null!=(t=e.fullName)?t:""}},{key:"product",header:"Product",render:e=>(0,a.jsx)("span",{className:"text-gray-700",children:e.productName||"â"})},{key:"requested",header:"Requested",render:e=>null!=e.requestedAmount?(0,a.jsx)("span",{className:"font-mono",children:(0,l.Ip)(e.requestedAmount)}):"â",align:"right",sortBy:e=>{var t;return null!=(t=e.requestedAmount)?t:0}},{key:"paid",header:"Paid out",render:e=>null!=e.actualSellAmount?(0,a.jsx)("span",{className:"font-mono",children:(0,l.Ip)(e.actualSellAmount)}):"â",align:"right",sortBy:e=>{var t;return null!=(t=e.actualSellAmount)?t:0}},{key:"fee",header:"Fee",render:e=>null!=e.paymentProviderFee?(0,a.jsx)("span",{className:"font-mono text-gray-600",children:(0,l.Ip)(e.paymentProviderFee)}):"â",align:"right"},{key:"provider",header:"Provider",render:e=>(0,a.jsx)("span",{className:"text-gray-600",children:e.provider||"â"})},{key:"status",header:"Sell state",render:e=>(0,a.jsxs)("div",{className:"leading-tight",children:[(0,a.jsx)(l.qs,{tone:function(e){let t=(null!=e?e:"").toLowerCase();return t.includes("paid to customer")?"success":t.includes("pending")?"warning":t.includes("fail")||t.includes("error")?"danger":"info"}(e.sellStatusDescription),children:e.sellStatusDescription||"â"}),e.wealthOrderStatus&&(0,a.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:e.wealthOrderStatus})]}),sortBy:e=>{var t;return null!=(t=e.sellStatusDescription)?t:""}}];
1function o(){let[e,t]=(0,s.useState)("sa"),[r,o]=(0,s.useState)(""),[u,c]=(0,s.useState)([]),[m,h]=(0,s.useState)(null),[x,g]=(0,s.useState)(!0),[p,w]=(0,s.useState)(null);(0,s.useEffect)(()=>{let t=!1;return g(!0),w(null),d.KD.getWithdrawalsRegister(e,1,200).then(e=>{if(!t)if(e.success&&e.data){var r,a;c(null!=(r=e.data.withdrawals)?r:[]),h(null!=(a=e.data.summary)?a:null)}else w(e.error||"Failed to load withdrawals"),c([])}).catch(e=>{t||(w((null==e?void 0:e.message)||"Failed to load withdrawals"),c([]))}).finally(()=>{t||g(!1)}),()=>{t=!0}},[e]);let y=(0,s.useMemo)(()=>{let e=r.toLowerCase();return e?u.filter(t=>{var r,a;return(null!=(r=t.fullName)?r:"").toLowerCase().includes(e)||(null!=(a=t.productName)?a:"").toLowerCase().includes(e)||t.customerId.toLowerCase().includes(e)}):u},[r,u]);return(0,a.jsxs)(l.Ay,{title:"Withdrawals register",owner:"Investment Operations \xb7 Siba",backend:"live-saasport",workflowRef:"GET /v1/admin/wealth/withdrawals \xb7 replaces 33-tab Excel",description:"Direct replacement for Siba's Withdrawals_Register_DashBoard_Executive.xlsx. Live data from WithdrawalsAdminController â every Sell across all customers, with state, payout, and fee.",children:[(0,a.jsxs)(l.Qn,{children:[(0,a.jsx)(l.Jt,{label:"Country",value:e,onChange:e=>t(e),options:n.map(e=>({value:e,label:e.toUpperCase()}))}),(0,a.jsx)(l.Te,{value:r,onChange:o,placeholder:"Customer, product, IDâ¦",width:280})]}),m&&(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-4 ring-1 ring-gray-200",children:[(0,a.jsx)("div",{className:"text-xs text-gray-500 uppercase tracking-wider",children:"Total requested"}),(0,a.jsx)("div",{className:"text-xl font-semibold text-gray-900 mt-1 font-mono",children:(0,l.Ip)(m.totalRequested)})]}),(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-4 ring-1 ring-emerald-200",children:[(0,a.jsx)("div",{className:"text-xs text-gray-500 uppercase tracking-wider",children:"Total paid out"}),(0,a.jsx)("div",{className:"text-xl font-semibold text-gray-900 mt-1 font-mono",children:(0,l.Ip)(m.totalPaidOut)})]}),(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-4 ring-1 ring-blue-200",children:[(0,a.jsx)("div",{className:"text-xs text-gray-500 uppercase tracking-wider",children:"Total fees retained"}),(0,a.jsx)("div",{className:"text-xl font-semibold text-gray-900 mt-1 font-mono",children:(0,l.Ip)(m.totalFees)})]})]}),p&&(0,a.jsx)("div",{className:"mb-4 bg-red-50 border border-red-200 rounded-lg p-3 text-sm text-red-700",children:p}),x?(0,a.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg p-12 text-center text-gray-500 text-sm",children:"Loading withdrawalsâ¦"}):(0,a.jsx)(l.bQ,{rows:y,columns:i,rowKey:e=>"".concat(e.customerId,"-").concat(e.dateCreated),emptyLabel:"No withdrawals match the current filters."})]})}},82284:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/withdrawals-register",function(){return r(11870)}])}},e=>{e.O(0,[37497,62842,90636,46593,38792],()=>e(e.s=82284)),_N_E=e.O()}]);
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.