<h2 class="govuk-body">
<div class="govuk-grid-row app-search__caption">
  <div class="govuk-grid-column-three-quarters">
    <%= render(SearchResultCaptionComponent.new(searched:, count: pagy.count, item_label:, total_count:, item: "logs", filters_count: applied_filters_count(@filter_type))) %>
    <% if logs&.any? %>
      <%= govuk_link_to "Download (CSV)", csv_download_url, type: "text/csv", class: "govuk-!-margin-right-4", style: "white-space: nowrap" %>
      <% if @current_user.support? %>
        <%= govuk_link_to "Download (CSV, codes only)", csv_codes_only_download_url, type: "text/csv", class: "govuk-!-margin-right-4", style: "white-space: nowrap" %>
      <% end %>
    <% end %>
  </div>
  <div class="govuk-grid-column-one-quarter govuk-!-text-align-right">
    <% if searched || applied_filters_count(@filter_type).positive? %>
      <br>
    <% end %>
    <% if logs&.any? && (display_delete_logs?(@current_user, searched, filter_type) || in_organisations_tab?) %>
      <%= govuk_link_to "Delete logs", delete_logs_path, class: "app-!-colour-red" %>
    <% end %>
  </div>
</div>
</h2>
<% logs.map do |log| %>
  <% if log.sales? %>
    <%= render SalesLogSummaryComponent.new(current_user:, log:) %>
    <% else %>
    <%= render LettingsLogSummaryComponent.new(current_user:, log:) %>
  <% end %>
<% end %>