{% load wagtailadmin_tags %}

<button type="button"
    class="{{ nav_icon_button_classes }}"
    aria-label="{{ toggle.aria_label }}"
    aria-expanded="false"
    data-controller="w-tooltip"
    data-side-panel-toggle="{{ panel.name }}"
    data-w-tooltip-content-value="{{ panel.title }}"
    data-w-tooltip-offset-value="[0, 0]"
>
    {% icon name=toggle.icon_name classname=nav_icon_classes %}
    {% if toggle.has_counter %}
        <div data-side-panel-toggle-counter class="{{ nav_icon_counter_classes }} {{ toggle.counter_classname|default:'w-bg-surface-button-default'}}" {% if not count %}hidden{% endif %}>
            {{ count }}
        </div>
    {% endif %}
</button>
