<% @page_title = @user_filtering.selected_collections_label %>
<% turbo_exempts_page_from_cache %>

<%= render "cards/broadcasts", filter: @filter %>

<% content_for :header do %>
  <h1 class="header__title divider divider--fade full-width">
    <span class="overflow-ellipsis txt-capitalize-first-letter"><%= @user_filtering.selected_collections_label %></span>
  </h1>

  <div class="header__actions header__actions--end">
    <% if collection = @filter.single_collection %>
      <%= link_to_edit_collection collection %>
    <% end %>
  </div>
<% end %>

<%= render "filters/settings", filter_url: cards_path, user_filtering: @user_filtering, no_filtering_url: cards_path %>

<%= turbo_frame_tag :cards_container do %>
  <section class="cards cards--grid">
    <%= with_automatic_pagination :cards_paginated_container, @page do %>
      <%= render "cards/display/previews", cards: @page.records, draggable: true %>
    <% end %>
  </section>
<% end %>
