{% extends '@WebProfiler/Profiler/layout.html.twig' %}

{% block toolbar %}
    {% if collector.currency is not null %}
        {% set status_color = collector.currency is null ? 'red' : '' %}

        {% set icon %}
            {{ include('@CoreShopCore/Collector/Icon/currency.svg') }}
            <span class="sf-toolbar-value">{{ collector.currency.name|default('Undefined') }}</span>
        {% endset %}

        {% set text %}
            <div class="sf-toolbar-info-piece">
                <b>Currencies</b>
                <span class="sf-toolbar-status {% if collector.currencies is empty %}sf-toolbar-status-red{% endif %}">{{ collector.currencies|length }}</span>
            </div>

            {% for currency in collector.currencies %}
                <div class="sf-toolbar-info-piece">
                    <b>{{ currency.name }}</b>
                    <span>({{ currency.isocode }}){% if collector.isCurrencyChangeSupported %} (<a href="?_currency_id={{ currency.id }}">change</a>){% endif %}</span>
                </div>
            {% endfor %}
        {% endset %}

        {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: false, status: status_color }) }}
    {% endif %}
{% endblock %}
