<%# Display user avatar information with associated details %>
<div class="d-flex align-items-center gap-2">
  <div class="d-flex align-items-center gap-2">
    <%= link_to domain_user_path(user_avatar.user),
                class: "badge bg-primary",
                target: "_blank" do %>
      <i class="fa-solid fa-image-portrait me-1"></i>Domain::UserAvatar #<%= user_avatar.id %>
    <% end %>
    <% if user_avatar.url_str.present? %>
      <%= link_to user_avatar.url_str,
                  class: "badge bg-secondary text-truncate-link",
                  target: "_blank",
                  rel: "noopener noreferrer nofollow" do %>
        <i class="fa-solid fa-link me-1"></i><%= user_avatar.url_str %>
      <% end %>
    <% end %>
  </div>
  <div class="d-flex align-items-center ms-auto gap-2">
    <% if user_avatar.log_entry.present? %>
      <%= link_to Rails.application.routes.url_helpers.log_entry_path(user_avatar.log_entry),
                  class: "badge bg-secondary",
                  target: "_blank" do %>
        <i class="fa-solid fa-file-lines me-1"></i>HttpLogEntry #<%= user_avatar.log_entry.id %>
      <% end %>
    <% end %>
    <span class="badge <%= case user_avatar.state
                         when "ok" then "bg-success"
                         when "pending" then "bg-warning text-dark"
                         else "bg-danger"
                         end %>">
      <i class="fa-solid <%= case user_avatar.state
                           when "ok" then "fa-check"
                           when "pending" then "fa-clock"
                           else "fa-exclamation-triangle"
                           end %> me-1"></i><%= user_avatar.state %>
    </span>
    <% if user_avatar.error_message.present? %>
      <span class="badge bg-danger" title="<%= user_avatar.error_message %>">
        <i class="fa-solid fa-circle-exclamation me-1"></i>Error
      </span>
    <% end %>
    <% if user_avatar.downloaded_at.present? %>
      <span class="badge bg-light text-dark" title="<%= time_ago_in_words(user_avatar.downloaded_at) %> ago">
        <i class="fa-regular fa-clock me-1"></i><%= user_avatar.downloaded_at.strftime("%Y-%m-%d %H:%M:%S") %>
      </span>
    <% end %>
  </div>
</div>
