import { ErrorBlock, List, NavBar, PullToRefresh, Tag } from 'antd-mobile'; import { useQuery } from '@tanstack/react-query'; import { useAuthStore } from '@/stores/authStore'; import { WithdrawResp, withdrawApi } from '@/api/withdraw'; const STATUS_COLOR: Record = { REQUESTED: 'default', APPROVED: 'primary', SENT: 'success', COMPLETED: 'success', FAILED: 'danger', CANCELLED: 'default', }; export default function WithdrawList() { const agentId = useAuthStore((s) => s.profile?.agentId); const { data, isLoading, refetch } = useQuery({ queryKey: ['withdraws', agentId], enabled: !!agentId, queryFn: () => withdrawApi.list({ agentId, pageNum: 1, pageSize: 50 }), }); const items = data?.list ?? []; return (
출금 신청 { await refetch(); }}>
{!agentId && ( )} {agentId && !isLoading && items.length === 0 && ( )} {items.length > 0 && ( {items.map((w: WithdrawResp) => ( #{w.requestId} {w.settleMonth ?? ''} } description={ {w.bankCode ?? '-'} · {w.accountNo ?? '-'} · {w.amount.toLocaleString()}원 {w.transferTxId && <> · txId={w.transferTxId}} } extra={{w.statusName ?? w.status}} /> ))} )}
); }