% content_for :title, t("indexa_capital_items.setup_accounts.title") %>
<%= render DS::Dialog.new(disable_click_outside: true) do |dialog| %>
<% dialog.with_header(title: t("indexa_capital_items.setup_accounts.title")) do %>
<%= icon "info", size: "sm", class: "text-primary mt-0.5 flex-shrink-0" %>
<%= t("indexa_capital_items.setup_accounts.instructions") %>
<%= form_with url: complete_account_setup_indexa_capital_item_path(@indexa_capital_item),
method: :post,
data: {
controller: "loading-button",
action: "submit->loading-button#showLoading",
loading_button_loading_text_value: t("indexa_capital_items.setup_accounts.creating"),
turbo_frame: "_top"
} do |form| %>
<% if @unlinked_accounts.any? %>
<%= t("indexa_capital_items.setup_accounts.accounts_count", count: @unlinked_accounts.count) %>
<% @unlinked_accounts.each do |indexa_capital_account| %>
<% end %>
<%= render DS::Button.new(
text: t("indexa_capital_items.setup_accounts.import_selected"),
variant: "primary",
icon: "plus",
type: "submit",
class: "flex-1",
data: { loading_button_target: "button" }
) %>
<%= render DS::Link.new(
text: t("indexa_capital_items.setup_accounts.cancel"),
variant: "secondary",
href: accounts_path,
frame: "_top"
) %>
<% else %>
<%= icon "alert-circle", size: "lg", class: "text-warning" %>
<%= t("indexa_capital_items.setup_accounts.no_accounts_to_setup") %>
<%= t("indexa_capital_items.setup_accounts.no_accounts") %>
<%= render DS::Link.new(
text: t("indexa_capital_items.setup_accounts.cancel"),
variant: "secondary",
href: accounts_path,
frame: "_top"
) %>
<% end %>
<% end %>
<% end %>
<% end %>