<div class="d-flex flex-row justify-content-between align-items-center mb-3">
  <%= link_to "Download All Reports", [@project, :report_downloads], method: :post, remote: true, class: "btn btn-light border" %>
  
  <%= bootstrap_form_with url: [@project, :reports], method: :get, remote: true, layout: :inline, id: "search" do |form| %>
    <%= form.search_field :query, hide_label: true, placeholder: t("shared.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.video_name") %></th>
        <th><%= t(".table_headers.video_number") %></th>
        <th><%= t(".table_headers.report_name") %></th>
        <th><%= t(".table_headers.report_published_at") %></th>
        <th></th>
      </tr>
    </thead>
    <tbody id="reports">
      <% if @reports.any? %>
        <%= render @reports %>
      <% else %>
        <tr>
          <td colspan="5" class="py-4 text-center text-muted"><%= t(".empty") %></td>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>

<div id="reports_pagination" class="mt-3">
  <%= will_paginate @reports %>
</div>
