import { TFunction } from 'i18next';
import { ProcessResult } from "../types";
import { AccountHolderResultStatus, AccountHolderSearchCl } from "./types";


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

export const getSearchTypeOption = (t: TFunction) => [
  { name: t('additionalService.accountHolderSearch.accountHolder'), value: AccountHolderSearchCl.ACCOUNT_NAME },
  { name: t('additionalService.accountHolderSearch.accountNumber'), value: AccountHolderSearchCl.ACCOUNT_NO },
];


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

  const resultStatusMap: Record<string, string> = {
    'SUCCESS': t('additionalService.common.success'),
    'FAIL': t('additionalService.common.fail')
  };
  return resultStatusMap[status] || status;
}