import React from 'react';
import { Tag } from 'antd';
import type { WithdrawalStatus } from '@rent/shared-types';
import { WITHDRAWAL_STATUS_MAP } from '@rent/shared-types';

interface WithdrawalStatusTagProps {
  status: WithdrawalStatus;
}

/**
 * 提现状态标签组件
 */
export const WithdrawalStatusTag: React.FC<WithdrawalStatusTagProps> = ({ status }) => {
  const config = WITHDRAWAL_STATUS_MAP[status];

  if (!config) {
    return <Tag>{status}</Tag>;
  }

  return <Tag color={config.color}>{config.label}</Tag>;
};
