{% load wagtailadmin_tags %}

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