<%# Modal: Link an existing manual account to a SimpleFIN account %> <%= turbo_frame_tag "modal" do %> <%= render DS::Dialog.new do |dialog| %> <% dialog.with_header(title: "Link SimpleFIN account") %> <% dialog.with_body do %> <% if @available_simplefin_accounts.blank? %>

<%= t("simplefin_items.select_existing_account.no_accounts_found") %>

<% else %> <%= form_with url: link_existing_account_simplefin_items_path, method: :post, class: "space-y-4" do %> <%= hidden_field_tag :account_id, @account.id %>
<% @available_simplefin_accounts.each do |sfa| %> <% end %>
<%= render DS::Button.new(text: "Link", variant: :primary, icon: "link-2", type: :submit) %> <%= render DS::Link.new(text: "Cancel", variant: :secondary, href: accounts_path, data: { turbo_frame: "_top" }) %>
<% end %> <% end %> <% end %> <% end %> <% end %>