import StatusBadge from '@/components/member/status-badge';
import type { BadgeTone } from '@/components/member/status-badge';

const tones: Record<string, BadgeTone> = {
    pending: 'pending',
    approved: 'info',
    paid: 'success',
    rejected: 'failed',
    cancelled: 'neutral',
};

export type WithdrawalItem = {
    id: number;
    reference: string;
    amount: number;
    reason: string;
    paymentMethod: string;
    paymentMethodLabel: string;
    bankName: string | null;
    accountNumber: string | null;
    accountName: string | null;
    status: string;
    statusLabel: string;
    reviewNote: string | null;
    paymentReference: string | null;
    requestedAt: string | null;
    reviewedAt: string | null;
    paidAt: string | null;
};

export default function WithdrawalStatus({
    status,
    label,
}: {
    status: string;
    label: string;
}) {
    return <StatusBadge tone={tones[status] ?? 'neutral'}>{label}</StatusBadge>;
}
