<%= turbo_frame_tag "modal" do %> <%= render DS::Dialog.new do |dialog| %> <% dialog.with_header(title: t(".title", default: "Select Your Bank")) %> <% dialog.with_body do %>

<%= t(".description", default: "Choose the bank you want to connect to your account.") %>

<% if @error_message.present? %>
<%= @error_message %>
<% end %> <% if @aspsps.present? %>
<% @aspsps.each do |aspsp| %> <%= button_to authorize_enable_banking_item_path(@enable_banking_item), method: :post, params: { aspsp_name: aspsp[:name], new_connection: @new_connection }, class: "w-full flex items-center gap-4 p-3 rounded-lg border border-primary bg-container hover:bg-subtle transition-colors text-left", data: { turbo: false } do %> <% if aspsp[:logo].present? %> <%= aspsp[:name] %> <% else %>
<%= icon "building-bank", class: "w-5 h-5 text-gray-400" %>
<% end %>

<%= aspsp[:name] %>

<% if aspsp[:bic].present? %>

BIC: <%= aspsp[:bic] %>

<% end %>
<%= icon "chevron-right", class: "w-5 h-5 text-secondary" %> <% end %> <% end %>
<% else %>

<%= t(".no_banks", default: "No banks available for this country.") %>

<%= t(".check_country", default: "Please check your country code setting.") %>

<% end %>
<%= link_to t(".cancel", default: "Cancel"), settings_providers_path, class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded-lg text-primary button-bg-secondary hover:button-bg-secondary-hover", data: { turbo_frame: "_top", action: "DS--dialog#close" } %>
<% end %> <% end %> <% end %>