{% sw_extends '@Storefront/storefront/page/account/_page.html.twig' %}

{% block page_account_main_content %}
    <div class="account-address account-address-form">
        {% block page_account_address_form_welcome %}
            <div class="account-welcome">
                {% block page_account_address_form_welcome_headline %}
                    <h1>
                        {{ "account.addressEditWelcome"|trans|sw_sanitize }}
                    </h1>
                {% endblock %}
            </div>
        {% endblock %}

        {% block page_account_address_form_main %}
            <div class="card">
                <div class="card-body">
                    {% block page_account_address_form_edit %}
                        <form method="post"
                              action="{{ path('frontend.account.address.edit.save', { 'addressId': page.address.id }) }}"
                              data-form-validation="true">
                            {% block page_account_address_form_edit_personal %}
                                {% sw_include '@Storefront/storefront/component/address/address-personal.html.twig' with {
                                    'data': page.address,
                                    'prefix': 'address'
                                } %}
                            {% endblock %}

                            {% block page_account_address_form_edit_general %}
                                {% sw_include '@Storefront/storefront/component/address/address-form.html.twig' with {
                                    'data': page.address,
                                    'prefix': 'address',
                                    'showFormCompany': true,
                                    'showNoShippingPostfix': true,
                                } %}
                            {% endblock %}

                            {% block page_account_address_required %}
                                <p class="address-required-info required-fields">
                                    {{ "general.requiredFields"|trans|sw_sanitize }}
                                </p>
                            {% endblock %}

                            {% block page_account_address_action_buttons %}
                                <div class="address-form-actions">
                                    {% block page_account_address_action_button_send %}
                                        <button type="submit"
                                                class="address-form-submit btn btn-primary"
                                                title="{{ "account.addressSaveChange"|trans|striptags }}">
                                            {{ "account.addressSaveChange"|trans|sw_sanitize }}
                                        </button>
                                    {% endblock %}
                                </div>
                            {% endblock %}
                        </form>
                    {% endblock %}
                </div>
            </div>
        {% endblock %}
    </div>
{% endblock %}
