{% extends 'base.html.twig' %}

{% block title %}{{ 'withdrawal.success.page_title'|trans }}{% endblock %}

{% block header %}{% endblock %}

{% block main %}
    <header class="theme-product-header">
        {% include 'partials/_nav.html.twig' %}
    </header>

    <section class="theme-page theme-auth-page">
        <div class="theme-container">
            <article class="theme-auth-card theme-auth-card--single">
                <div class="theme-auth-card__heading">
                    <p class="theme-eyebrow">{{ 'withdrawal.success.eyebrow'|trans }}</p>
                    <h2>{{ 'withdrawal.success.heading'|trans }}</h2>
                    <p>{{ 'withdrawal.success.intro'|trans }}</p>
                </div>

                <dl class="theme-order-card__details theme-account-form__section">
                    <div>
                        <dt>{{ 'withdrawal.summary.name'|trans }}</dt>
                        <dd>{{ withdrawal_request.firstname }} {{ withdrawal_request.lastname }}</dd>
                    </div>
                    <div>
                        <dt>{{ 'withdrawal.summary.reference'|trans }}</dt>
                        <dd>{{ withdrawal_request.contractReference }}</dd>
                    </div>
                    <div>
                        <dt>{{ 'withdrawal.summary.email'|trans }}</dt>
                        <dd>{{ withdrawal_request.receiptEmail }}</dd>
                    </div>
                    <div>
                        <dt>{{ 'withdrawal.summary.order_received'|trans }}</dt>
                        <dd>{{ (withdrawal_request.orderReceived is same as(true) ? 'withdrawal.form.yes' : (withdrawal_request.orderReceived is same as(false) ? 'withdrawal.form.no' : 'withdrawal.form.not_provided'))|trans }}</dd>
                    </div>
                    {% if withdrawal_request.orderReceived and withdrawal_request.receivedAt %}
                        <div>
                            <dt>{{ 'withdrawal.summary.received_at'|trans }}</dt>
                            <dd>{{ withdrawal_request.receivedAt|date('d/m/Y') }}</dd>
                        </div>
                    {% endif %}
                    {% if withdrawal_request.reasonCode %}
                        <div>
                            <dt>{{ 'withdrawal.summary.reason'|trans }}</dt>
                            <dd>{{ ('withdrawal.reason.' ~ withdrawal_request.reasonCode)|trans }}</dd>
                        </div>
                    {% endif %}
                    {% if withdrawal_request.comment %}
                        <div>
                            <dt>{{ 'withdrawal.summary.comment'|trans }}</dt>
                            <dd class="whitespace-pre-line">{{ withdrawal_request.comment }}</dd>
                        </div>
                    {% endif %}
                    <div>
                        <dt>{{ 'withdrawal.summary.submitted_at'|trans }}</dt>
                        <dd>{{ withdrawal_request.submittedAt|date('d/m/Y H:i:s T') }}</dd>
                    </div>
                </dl>

                <p class="theme-form-note">{{ 'withdrawal.success.next_steps'|trans }}</p>
            </article>
        </div>
    </section>
{% endblock %}
