import { TFunction } from 'i18next';
import { SmsCl } from './types';

export const getSmsClBtnGroup = (t: TFunction) => [
  { name: '', value: SmsCl.ALL },
  { name: t('additionalService.sms.virtualAccountRequest'), value: SmsCl.VACCOUNT_REQ },
  { name: t('additionalService.sms.virtualAccountRequestDeposit'), value: SmsCl.VACCOUNT_REQ_DEPOSIT }
];

export const getSmsClName = (t: TFunction) => (smsCl?: string): string => {
  if (!smsCl) return '';
  const found = getSmsClBtnGroup(t).find(item => item.value === smsCl);
  return found ? found.name : smsCl;
};
