<%# Display user information with associated details %>
<div class="d-flex align-items-center gap-2">
  <div class="d-flex align-items-center gap-2">
    <% attr = user.class.param_prefix_and_attribute[1] %>
    <%= link_to Rails.application.routes.url_helpers.domain_user_path(user),
                class: "badge bg-primary",
                target: "_blank" do %>
      <i class="fa-solid fa-user me-1"></i><%= user.class.name %> #<%= user.id %>
    <% end %>
    <span class="badge bg-secondary text-truncate" title="<%= user.send(attr) %>">
      <i class="fa-solid fa-signature me-1"></i><%= attr %>: <%= user.send(attr) %>
    </span>
    <% if user.name_for_view.present? %>
      <span class="badge bg-info text-truncate" title="<%= user.name_for_view %>">
        <i class="fa-solid fa-signature me-1"></i><%= user.name_for_view %>
      </span>
    <% end %>
  </div>
  <div class="d-flex align-items-center ms-auto gap-2">
    <% if user.external_url_for_view.present? %>
      <%= link_to user.external_url_for_view,
                  class: "badge bg-secondary text-truncate-link",
                  target: "_blank",
                  rel: "noopener noreferrer nofollow" do %>
        <i class="fa-solid fa-link me-1"></i><%= user.class.view_prefix.upcase %>
      <% end %>
    <% end %>
    <span class="badge <%= user.account_status_for_view == "ok" ? "bg-success" : "bg-danger" %>">
      <i class="fa-solid <%= user.account_status_for_view == "ok" ? "fa-check" : "fa-exclamation-triangle" %> me-1"></i>
      <%= user.account_status_for_view %>
    </span>
    <% if registered_at = domain_user_registered_at_string_for_view(user) %>
      <span class="badge bg-light text-dark" title="<%= registered_at %>">
        <i class="fa-regular fa-clock me-1"></i><%= registered_at %>
      </span>
    <% end %>
    <% if user.avatar.present? %>
      <span class="badge bg-light text-dark">
        <i class="fa-solid fa-image-portrait me-1"></i>Has Avatar
      </span>
    <% end %>
  </div>
</div>
