{% import "system/macro/form/confirmation.html.twig" as form_confirmation %}
{% import "system/macro/navigation/breadcrumb.html.twig" as breadcrumb %}

{% if not isPluginUnlocked() %}
    {{ messages() | raw }}
{% else %}
    {{ breadcrumb.component({
        items: [
            localized.breadcrumb.module
        ]
    }, localized) }}

    {{ messages() | raw }}

    {% embed "system/embed/card/card-with-info-panel-below.html.twig" %}
        {% import "provider/macro/provider-table.html.twig" as provider_table %}
        {% import "system/macro/card/card-heading.html.twig" as card_heading %}

        {% block mainHeader %}
            {{ card_heading.component({
                title: localized.headline.providers,
                buttonText: localized.global.button.addNew,
                buttonLink: wpNonceUrl("?page=#{controllerId}&action=edit&id=-1", "#{controllerId}--1-edit")
            }, localized) }}
        {% endblock %}

        {% block mainContent %}
            {{ provider_table.component({
                controllerId: controllerId,
                provider: data.provider,
            }, localized) }}
        {% endblock %}

        {% block infoPanelHeader %}
            {{ localized.global.headline.thingsToKnow | raw }}
        {% endblock %}

        {% block infoPanelContent %}
            {% embed "system/embed/accordion/accordion-group.html.twig" %}
                {% block content %}
                    {% embed "system/embed/accordion/accordion.html.twig" with { id: 'purposeProviders', expanded: true, } %}
                        {% block title %}
                            {{ localized.thingsToKnow.headlinePurposeProviders | raw }}
                        {% endblock %}
                        {% block content %}
                            <p>{{ localized.thingsToKnow.purposeProvidersExplainedA | raw }}</p>
                            <p>{{ localized.thingsToKnow.purposeProvidersExplainedB | raw }}</p>
                            <p>{{ localized.thingsToKnow.purposeProvidersExplainedC | raw }}</p>
                        {% endblock %}
                    {% endembed %}

                    {% embed "system/embed/accordion/accordion.html.twig" with { id: 'symbolsExplained' } %}
                        {% import "system/macro/icons/edit.html.twig" as edit_icon %}
                        {% import "system/macro/icons/trash.html.twig" as trash_icon %}

                        {% block title %}
                            {{ localized.thingsToKnow.headlineSymbolsExplained | raw }}
                        {% endblock %}
                        {% block content %}
                            <ul class="bc-space-y-2 bc-text-left">
                                <li>{{ trash_icon.component({}) }} {{ localized.thingsToKnow.symbolExplainedDelete | raw }}</li>
                                <li>{{ edit_icon.component({}) }} {{ localized.thingsToKnow.symbolExplainedEdit | raw }}</li>
                            </ul>
                        {% endblock %}
                    {% endembed %}
                {% endblock %}
            {% endembed %}
        {% endblock %}
    {% endembed %}
    <!-- Reset Provider -->
    <hr>
    {{ form_confirmation.component({
        action: 'reset',
        headline: localized.headline.resetDefaultProviders,
        hint: localized.hint.reset,
        nonce: wpNonceField("#{controllerId}-reset"),
        route: "?page=#{controllerId}",
    }, localized) }}
{% endif %}
