<%# Display post file information with status and details %>
<% post = post_file.post %>
<% log_entry = post_file.log_entry %>
<div class="d-flex align-items-center gap-2">
  <div class="d-flex align-items-center gap-2">
    <span class="badge bg-primary">
      <i class="fa-solid fa-file me-1"></i><%= post_file.class.name %> #<%= post_file.id %>
    </span>
    <%= link_to Rails.application.routes.url_helpers.domain_post_path(post),
                class: "badge bg-primary",
                target: "_blank" do %>
      <i class="fa-solid fa-image me-1"></i><%= post.class.name %> #<%= post.id %>
    <% end %>
  </div>
  <div class="d-flex align-items-center ms-auto gap-2">
    <% if log_entry.present? %>
      <%= link_to Rails.application.routes.url_helpers.log_entry_path(log_entry),
                  class: "badge bg-secondary",
                  target: "_blank" do %>
        <i class="fa-solid fa-file-lines me-1"></i>HttpLogEntry #<%= log_entry.id %>
      <% end %>
      <span class="badge <%= post_file.last_status_code.to_i < 400 ? "bg-success" : "bg-danger" %>">
        <i class="fa-solid fa-signal me-1"></i><%= post_file.last_status_code %>
      </span>
    <% elsif post_file.url_str.present? %>
      <%= link_to post_file.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><%= post_file.url_str %>
      <% end %>
    <% end %>
    <span class="badge <%= post_file_state_badge_class(post_file.state) %>">
      <i class="<%= post_file_state_icon_class(post_file.state) %> me-1"></i><%= post_file.state %>
    </span>
    <% if post_file.retry_count > 0 %>
      <span class="badge bg-secondary">
        <i class="fa-solid fa-rotate me-1"></i>Retries: <%= post_file.retry_count %>
      </span>
    <% end %>
    <% if post_file.blob.present? %>
      <span class="badge bg-light text-dark">
        <i class="fa-solid fa-file-arrow-down me-1"></i>SHA256: <%= HexUtil.bin2hex( post_file.blob.sha256[0..7] )%>
      </span>
    <% end %>
    <% if post_file.error_message.present? %>
      <span class="badge bg-danger" title="<%= post_file.error_message %>">
        <i class="fa-solid fa-circle-exclamation me-1"></i>Error
      </span>
    <% end %>
  </div>
</div>
