% content_for :title, t(".title") %>
<%= render DS::Dialog.new do |dialog| %>
<% dialog.with_header(title: t(".title")) do %>
<%= icon "globe", class: "text-primary" %>
<%= t(".subtitle") %>
<% end %>
<% dialog.with_body do %>
<%= form_with url: link_profiles_wise_items_path,
method: :post,
local: true,
data: { turbo_frame: "_top" },
class: "space-y-6" do |form| %>
<%= hidden_field_tag :encrypted_pending_token, @encrypted_pending_token %>
<%= t(".description") %>
<% @pending_profiles.each do |profile| %>
<% profile_id = profile["id"].to_s %>
<% already_connected = @existing_profile_ids.include?(profile_id) %>
<% profile_type = profile["type"] == "business" ? "business" : "personal" %>
<% details = profile["details"] || {} %>
<% display_name = details["name"].presence || [ details["firstName"], details["lastName"] ].compact.join(" ") %>
<% end %>
<%= render DS::Button.new(
text: t(".connect"),
variant: "primary",
icon: "link",
type: "submit",
class: "flex-1"
) %>
<%= render DS::Link.new(
text: t(".cancel"),
variant: "secondary",
href: settings_providers_path
) %>
<% end %>
<% end %>
<% end %>