import { TFunction } from 'i18next';
import { PayoutSearchDateType, PayoutDisbursementStatus } from './types';

export const getPayoutSearchClBtnGroup = (t: TFunction) => [
  {name: t('additionalService.payout.requestDate'), value: PayoutSearchDateType.REQUEST_DATE },
  {name: t('additionalService.payout.disbursementDate'), value: PayoutSearchDateType.SETTLEMENT_DATE }
];

export const getPayoutDisbursementStatusBtnGroup = (t: TFunction) => [
  {name: t('transaction.constants.all'), value: PayoutDisbursementStatus.ALL},
  {name: t('additionalService.common.request'), value: PayoutDisbursementStatus.REQUEST},
  {name: t('additionalService.common.success'), value: PayoutDisbursementStatus.SUCCESS},
  {name: t('additionalService.common.fail'), value: PayoutDisbursementStatus.FAIL},
];

export const getPayoutStatusText = (t: TFunction) => (status?: string): string => {
  if (!status) return '';

  const statusMap: Record<string, string> = {
    "REQUEST" : t('additionalService.common.request'),
    "SUCCESS" : t('additionalService.common.success'),
    "FAIL" : t('additionalService.common.fail')
  }

  return statusMap[status] || status;
}