<div
    {% if AuthController.knowledge.can_view %}
        @dblclick="window.location.href = '{% url "django_spire:knowledge:collection:page:detail" pk=0 %}'.replace(0, collection.id)"
        @click.prevent
    {% endif %}
    class="knowledge-nav-item cursor-pointer"
    @contextmenu.prevent="show_menu({event: $event, object: collection, type: 'collection'})"
>
    <i
        :class="collection.show_details ? 'bi bi-chevron-down' : 'bi bi-chevron-right'"
        {% if hide_chevron %}
        style="visibility: hidden"
        {% else %}
        :style="{visibility: (collection.has_child_collections() || collection.has_entries()) ? 'visible' : 'hidden'}"
        {% endif %}
        @click="collection.toggle_show_details({value: !collection.show_details})"
    ></i>
    <i class="bi bi-folder2 fs-5"></i>
    <span
        :class="collection.id === {{ collection.pk|default:0 }} ? 'text-app-accent' : ''"
        x-text="collection.name"
    >
    </span>
</div>
