<section class="notifications-list panel panel--wide center borderless unpad flex flex-column gap-half">
  <% if unread.any? %>
    <div class="flex align-center justify-space-between margin-block-start margin-block-end-half">
      <h2 class="txt-medium txt-uppercase txt-alert">New for you</h2>
      <%= button_to "Mark all as read", bulk_reading_path, class: "btn txt-small", form: { data: { turbo: false } }, data: { action: "badge#clear" } %>
    </div>
  <% else %>
    <div class="notifications-list__blank-slate blank-slate align-self-center">
      Nothing new for you
    </div>
  <% end %>

  <div id="notifications_list" contents>
    <%= render partial: "notifications/notification", collection: unread, cached: true %>
  </div>

  <% if unread.any? %>
    <% total_unread_count = Current.user.notifications.unread.count %>
    <% if total_unread_count > NotificationsController::MAX_UNREAD_NOTIFICATIONS %>
      <div class="fill-highlight txt-x-small border-radius pad-block-half pad-inline">
        Showing the <%= NotificationsController::MAX_UNREAD_NOTIFICATIONS %> most recent (<%= total_unread_count - NotificationsController::MAX_UNREAD_NOTIFICATIONS %> are hidden)
      </div>
    <% end %>
  <% end %>
</section>
