<div class="header">
  <div class="header-inner">
    <h5 class="header-name"><%= local_assigns[:index_path] ? link_to(name, index_path) : name.humanize %></h5>
    <div class="options">
      <%= render 'layouts/hera/add_item_dropdown',
        name: name,
        new_path: local_assigns[:new_path],
        category_id: local_assigns[:category_id],
        menu_class: 'pull-right'
      %>
      <%= link_to "##{name.downcase}", data: { bs_toggle: 'collapse', behavior: 'collapse-collection' }, class: local_assigns.fetch(:collapse_class, '') do %>
        <i class="fa-solid fa-chevron-up" data-behavior="toggle-chevron"></i><span class="visually-hidden">Toggle <%= name.downcase %> list</span>
      <% end %>
    </div>
  </div>
</div>

<div id="<%= name.downcase %>" class="note-list collapse show">
  <% if collection.any? %>
    <%= render partial: collection.first.to_partial_path, collection: collection %>
  <% end %>
  <div class="note dradis-placeholder <%= 'd-none' if collection.any? %>">(nothing yet)</div>
</div>
