(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[873],{17397:(e,t,a)=>{"use strict";a.d(t,{A:()=>v});var n=a(95155),l=a(12115),i=a(77325),s=a(97605),r=a(78831),d=a(18949),o=a(46996),c=a(74785),m=a(79659),x=a(56170),u=a(70129),p=a(54657),y=a(70302),j=a(20922),h=a(54160),g=a(19558),A=a(81730),b=a(83607),k=a(35695);function v(e){let{title:t,page:a,dropDownItems:v,filter:_}=e,f=(0,k.usePathname)(),N=(0,k.useRouter)(),[w,C]=(0,l.useState)(!1),I=f.split("/").filter(Boolean),D=I[I.length-1],S={"Add new":(0,n.jsx)(o.A,{}),Print:(0,n.jsx)(c.A,{}),Edit:(0,n.jsx)(m.A,{}),Delete:(0,n.jsx)(x.A,{}),Duplicate:(0,n.jsx)(u.A,{}),"Download PDF":(0,n.jsx)(p.A,{}),"Download Excel":(0,n.jsx)(y.A,{}),"Download CSV":(0,n.jsx)(j.A,{}),Send:(0,n.jsx)(h.A,{}),Save:(0,n.jsx)(g.A,{})},P=(0,l.useMemo)(()=>(v||[]).find(e=>"Print"===e.label),[v]),E=(0,l.useMemo)(()=>(v||[]).map(e=>"Print"===e.label?{...e,action:()=>{e.component?C(!0):e.url?N.push(e.url):window.print()}}:e),[v,N]),F=(0,l.useMemo)(()=>E.map((e,t)=>({key:String(t+1),label:e.label,icon:S[e.label]||null})),[E]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"bg-white py-3 border-y border-gray-100",children:[(0,n.jsx)("div",{className:"container",children:(0,n.jsxs)("div",{className:"flex justify-between items-center",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:["dashboard"!==a&&(0,n.jsx)(i.Ay,{type:"text",onClick:()=>window.history.back(),icon:(0,n.jsx)(A.A,{}),className:"md:hidden"}),(0,n.jsx)(s.A.Title,{level:5,className:"!mb-0 !text-base capitalize",children:t||D})]}),F.length>0&&(0,n.jsx)(r.A,{menu:{items:F,onClick:e=>{let{key:t,domEvent:a}=e;a.preventDefault();let n=null==E?void 0:E[parseInt(t,10)-1];n&&(n.action&&"function"==typeof n.action?n.action():n.url?N.push(n.url):console.warn('No action or URL defined for "'.concat(n.label,'"')))}},trigger:["click"],placement:"bottomRight",children:(0,n.jsx)(i.Ay,{type:"text",icon:(0,n.jsx)(b.A,{className:"text-lg text-gray-500"})})})]})}),_&&(0,n.jsx)("div",{className:"border-t border-gray-100 pt-3 mt-3",children:(0,n.jsx)("div",{className:"container",children:(0,n.jsx)(Filter,{})})})]}),(0,n.jsxs)(d.A,{title:(null==P?void 0:P.modaltitle)||"Print Document",open:w,onCancel:()=>C(!1),footer:null,width:"80%",children:[null==P?void 0:P.printData,null==P?void 0:P.component]})]})}a(23196)},39757:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>y});var n=a(95155),l=a(12115),i=a(35695),s=a(60838),r=a(77325),d=a(505),o=a(16467),c=a(95108),m=a(6139),x=a(80999),u=a(17397);let p=e=>fetch(e).then(e=>e.json());function y(){var e,t;let a=(0,i.useRouter)(),[y,j]=(0,l.useState)(1),[h]=(0,l.useState)(10),{data:g,error:A,isLoading:b}=(0,s.Ay)("/api/kyc?page=".concat(y,"&limit=").concat(h,"&orderby_created=true"),p),k=(null==g||null==(e=g.data)?void 0:e.map((e,t)=>({...e,key:e.kyc_id||t})))||[],v=[{title:"Customer ID",dataIndex:"customerId",key:"customerId"},{title:"Legal Name",dataIndex:"legal_name",key:"legal_name"},{title:"Trade Name",dataIndex:"trade_name",key:"trade_name"},{title:"Entity Type",dataIndex:"entity_type",key:"entity_type"},{title:"Incorporation Country",dataIndex:"incorporation_country",key:"incorporation_country"},{title:"Primary Contact",dataIndex:"primary_name",key:"primary_name"},{title:"Email",dataIndex:"primary_email",key:"primary_email"},{title:"Created At",dataIndex:"created_at",key:"created_at"},{title:"Actions",key:"actions",render:(e,t)=>(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(r.Ay,{type:"text",icon:(0,n.jsx)(x.A,{}),onClick:()=>a.push("/jhjkaghjasadsadfdssbda67asd87asdg85fsd43hjadgta/".concat(t.kyc_id))})})}];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.A,{title:"KYC List"}),(0,n.jsx)("div",{className:"large-container sm:pt-5",children:(0,n.jsx)(d.A,{styles:{body:{padding:0}},children:b?(0,n.jsx)("div",{className:"p-4 text-center",children:(0,n.jsx)(o.A,{})}):A?(0,n.jsx)("div",{className:"p-4",children:(0,n.jsx)(c.A,{message:"Failed to load data",type:"error"})}):(0,n.jsx)(m.A,{bordered:!0,columns:v,dataSource:k,pagination:{current:y,pageSize:h,total:(null==g||null==(t=g.pagination)?void 0:t.totalRecords)||0,onChange:e=>j(e),showSizeChanger:!1},size:"small",scroll:{x:"max-content"}})})})]})}},68135:(e,t,a)=>{Promise.resolve().then(a.bind(a,39757))}},e=>{var t=t=>e(e.s=t);e.O(0,[129,666,568,325,467,192,440,775,139,196,441,684,358],()=>t(68135)),_N_E=e.O()}]);