<div {{ attributes|raw }} data-poll="check">

    <div class="px-6 py-6">

        {% if not payment.paid %}

            {% if i < 10 %}
                {% include '@FerienpassCms/partial/modal_loading.html.twig' with {
                    headline: 'payment.check.headline'|trans({}, 'cms'),
                    text: 'payment.check.text'|trans({}, 'cms')~(range(0, i)|reduce((carry) => carry ~'.')),
                } %}
            {% else %}
                {% include '@FerienpassCms/partial/modal_error.html.twig' with {
                    headline: 'payment.check.errorHeadline'|trans({}, 'cms'),
                    text: 'payment.check.errorText'|trans({}, 'cms'),
                    href: path('cms', { to: 'applications' }),
                    linkText: 'payment.check.backToOverview'|trans({}, 'cms')
                } %}
            {% endif %}

        {% else %}

            {% include '@FerienpassCms/partial/modal_confirm.html.twig' with {
                headline: 'payment.check.successHeadline'|trans({}, 'cms'),
                text: 'payment.check.successText'|trans({'amount': payment.totalAmount/100}, 'cms'),
                href: path('cms', { to: 'applications' }),
                linkText: 'payment.check.backToOverview'|trans({}, 'cms')
            } %}

        {% endif %}

    </div>
</div>
