export type BankAccountSectionState = {
  bankNameDisabled: boolean;
  bankNameSuccess: boolean;
};

export function resolveBankAccountSectionState({
  disabled,
  bankAccountNumberValid,
  bankFound,
}: {
  disabled?: boolean;
  bankAccountNumberValid?: boolean;
  bankFound?: boolean;
}): BankAccountSectionState {
  return {
    bankNameDisabled: Boolean(disabled) || !bankAccountNumberValid,
    bankNameSuccess: Boolean(bankFound),
  };
}
