<%= 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 %>
<% if searched || applied_filters_count(@filter_type).positive? %>
<% 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 %>

<% logs.map do |log| %> <% if log.sales? %> <%= render SalesLogSummaryComponent.new(current_user:, log:) %> <% else %> <%= render LettingsLogSummaryComponent.new(current_user:, log:) %> <% end %> <% end %>