<%# locals: (form:, entry:, candidates:, accounts:) %> <% if candidates.any? %>

Select a method for matching your transactions.

<%= form.select :method, [ ["Match existing transaction (recommended)", "existing"], ["Create new transaction", "new"] ], { selected: "existing", label: "Matching method" }, data: { action: "change->transfer-match#update" } %>
<%= form.select :matched_entry_id, candidates.map { |entry| [entry_name_detailed(entry), entry.id] }, { label: "Matching transaction" } %>
<% else %>

We couldn't find any transactions to match from your other accounts. Please select an account and we will create a new inflow transaction for you.

<%= form.hidden_field :method, value: "new" %>
<%= form.select :target_account_id, accounts.map { |account| [account.name, account.id] }, { label: "Target account" } %>
<% end %>