<%= render(SearchResultCaptionComponent.new(searched:, count: pagy.count, item_label:, total_count:, item: "logs", path: request.path)) %> <% if logs&.any? %> <%= govuk_link_to "Download (CSV)", csv_download_url, type: "text/csv", class: "govuk-!-margin-right-4" %> <% if @current_user.support? %> <%= govuk_link_to "Download (CSV, codes only)", csv_codes_only_download_url, type: "text/csv", class: "govuk-!-margin-right-4" %> <% end %> <% 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 %>