{% from "components/panel/_macro.njk" import onsPanel %}

{% macro onsError(params) %}
    {% set content %}
        <p
            class="ons-panel__error"
            {% if params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ ' ' }}{{ attribute }}{% if value %}="{{ value }}"{% endif %}{% endfor %}{% endif %}
        >
            <strong>{{ params.text }}</strong>
        </p>
        {{ caller() }}
    {% endset %}

    {%
        call onsPanel({
            "variant": "error",
            "id": params.id
        })
    %}
        {{ content | safe }}
    {% endcall %}
{% endmacro %}
