Files
epusdt/src/www/assets/integrations-CnW6fhkK.js
T

1 line
3.3 KiB
JavaScript

import{Ao as e,Do as t,Fo as n,Mo as r,No as i,Oo as a,Po as o,af as s,cf as c,if as l,jo as u,ko as d}from"./messages-BSgosaSa.js";import{r as f}from"./route-C9oeyFaP.js";import{_ as p,f as m,n as h,p as g,r as _}from"./data-table-CGYy0mJd.js";import{t as v}from"./badge-B1BdxxCg.js";import{t as y}from"./use-table-url-state-BG55k9ho.js";var b=c(s(),1),x=l(),S=[{name:`GMPay`,entries:[{method:`POST`,path:`/payments/gmpay/v1/order/create-transaction`}],requestFields:[`order_id`,`currency`,`token`,`network`,`amount`,`notify_url`,`signature`,`redirect_url?`,`name?`,`payment_type?`],callbackNote:d()},{name:`EPay Compatible`,entries:[{method:`POST`,path:`/payments/epay/v1/order/create-transaction/submit.php`},{method:`GET`,path:`/payments/epay/v1/order/create-transaction/submit.php`}],requestFields:[`pid`,`money`,`out_trade_no`,`notify_url`,`return_url?`,`name?`,`type?`,`sign`,`sign_type?`],callbackNote:a()},{name:`OKPay`,entries:[{method:`POST`,path:`/payments/okpay/v1/notify`}],requestFields:[`OkPay notify payload`],callbackNote:t()}];function C({method:e}){return(0,x.jsx)(v,{className:e===`GET`?`rounded border border-blue-500/30 bg-blue-500/10 font-mono text-blue-600 dark:text-blue-400`:`rounded border border-emerald-500/30 bg-emerald-500/10 font-mono text-emerald-600 dark:text-emerald-400`,variant:`outline`,children:e})}function w({field:e}){return(0,x.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-foreground text-xs`,children:e})}function T({item:e}){let t=e.entries.reduce((e,t)=>(e[t.path]||(e[t.path]=[]),e[t.path].push(t.method),e),{});return(0,x.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:Object.entries(t).map(([e,t])=>(0,x.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,x.jsx)(`div`,{className:`flex gap-1.5`,children:t.map(e=>(0,x.jsx)(C,{method:e},e))}),(0,x.jsx)(`code`,{className:`whitespace-normal break-words font-mono text-sm`,children:e})]},e))})}function E({fields:e}){return(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.map(e=>(0,x.jsx)(w,{field:e},e))})}var D=f(`/_authenticated/payment-setup/integrations`);function O(){let{pagination:t,onPaginationChange:a,ensurePageInRange:s}=y({search:D.useSearch(),navigate:D.useNavigate(),pagination:{defaultPage:1,defaultPageSize:10}}),c=m({data:S,columns:(0,b.useMemo)(()=>[{accessorKey:`name`,header:i(),cell:({row:e})=>(0,x.jsx)(`span`,{className:`font-medium`,children:e.original.name})},{accessorKey:`entries`,header:r(),cell:({row:e})=>(0,x.jsx)(T,{item:e.original})},{accessorKey:`requestFields`,header:u(),cell:({row:e})=>(0,x.jsx)(E,{fields:e.original.requestFields})},{accessorKey:`callbackNote`,header:e(),cell:({row:e})=>(0,x.jsx)(`span`,{className:`whitespace-normal break-words text-muted-foreground text-sm`,children:e.original.callbackNote})}],[]),state:{pagination:t},onPaginationChange:a,getCoreRowModel:g(),getPaginationRowModel:p()});return(0,b.useEffect)(()=>{s(c.getPageCount())},[c,s]),(0,x.jsxs)(`div`,{className:`flex flex-1 flex-col gap-4`,children:[(0,x.jsxs)(`div`,{className:`space-y-1`,children:[(0,x.jsx)(`h3`,{className:`font-semibold text-lg`,children:n()}),(0,x.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:o()})]}),(0,x.jsx)(_,{table:c}),(0,x.jsx)(h,{className:`mt-auto`,table:c})]})}function k(){return(0,x.jsx)(O,{})}var A=k;export{A as component};