<div class="d-flex flex-row justify-content-between flex-row-reverse align-items-center mb-3">
  <%= bootstrap_form_with url: project_downloads_path, method: :get, remote: true, layout: :inline, id: "search" do |form| %>
    <%= form.search_field :query, hide_label: true, placeholder: t(".actions.search"), class: "rounded-pill-right", value: params[:query], prepend: form.button(fa_icon("search"), id: "search-button", class: "btn btn-light border rounded-pill-left") %>
  <% end %>
</div>

<div class="border bg-white rounded shadow-sm pb-3 table-responsive">
  <table class="table table-striped tr-px-4 align-all-middle">
    <thead class="thead-light">
      <tr>
        <th><%= t(".table_headers.download_name") %></th>
        <th><%= t(".table_headers.download_type") %></th>
        <th><%= t(".table_headers.download_status") %></th>
        <th><%= t(".table_headers.download_created_at") %></th>
        <th></th>
      </tr>
    </thead>
    <tbody id="downloads">
      <% if @downloads.any? %>
        <%= render partial: "download", collection: @downloads %>
      <% else %>
        <tr>
          <td colspan="5" class="py-4 text-center text-muted"><%= t(".empty") %></td>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>

<div id="downloads_pagination" class="mt-3">
  <%= will_paginate @downloads %>
</div>
