class="py-1 border-b border-gray-300 cursor-pointer"<% end %> data-type="collection"
x-data="{id: '<%= collection.id %>', hidden: false}"
@filtered="$nextTick(() => {hidden = !$el.querySelectorAll('[data-type=preview]:not(.hidden)').length})"
:class="{hidden}">
<%= render "partials/nav/label", text: collection.label, icon: "folder" %>
<% collection.items.each do |item| %>
<% if item.type == :collection %>
<%= render "partials/nav/collection", collection: item %>
<% elsif item.type == :preview %>
<%= render "partials/nav/preview", preview: item %>
<% end %>
<% end %>