<% @page_title = "Home" %>
<% @header_class = "header--events" %>

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

<% content_for :header do %>
  <%= render "events/index/add_card_button", user_filtering: @user_filtering %>

  <h1 class="header__title">
    <% if @user_filtering.collections.one? %>
      Latest Activity
    <% else %>
      <span>Activity <%= @user_filtering.filter.collections.any? ? "in" : "across" %></span>
      <%= render "events/index/filter", user_filtering: @user_filtering %>
    <% end %>
  </h1>
<% end %>

<%= tag.div id: "activity", class: "events", data: { controller: "pagination", pagination_paginate_on_intersection_value: true } do %>
  <%= day_timeline_pagination_frame_tag @day_timeline do %>
    <%= render "events/day", day_timeline: @day_timeline %>

    <%= day_timeline_pagination_link(@day_timeline, @filter) %>
  <% end %>
<% end %>

<div class="events__welcome-video flex justify-center">
  <iframe
      frameborder="0"
      src="https://www.youtube.com/embed/kAgUQbD9Wc0?si=IIjKjUIk5PchL0-a"
      title="BOXCAR Beta orientation"
      allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
      referrerpolicy="strict-origin-when-cross-origin"
      allowfullscreen></iframe>
</div>
