<table class="mall-table mall-address-list__table">
    {% for address in __SELF__.addresses %}
        <tr>
            <td>
                {% if address.company %}
                    {{ address.company }}<br/>
                {% endif %}
                {{ address.name }}<br/>
            </td>
            <td>
                {{ address.lines | nl2br }}<br/>
                {{ address.zip }} {{ address.city }}<br/>
                {% if address.state_id %}
                    {{ address.state.name }}<br/>
                {% endif %}
                {{ address.country.name }}
            </td>
            <td>
                <div class="mall-switcher__outer">
                    <div class="mall-switcher">
                        <a href="javascript:;" data-request="onChangeDefaultBillingAddress"
                           data-request-data="id: '{{ address.hashId }}'" data-request-flash
                           class="mall-switcher__item {{ __SELF__.defaultBillingAddressId == address.id ? 'mall-switcher__item--active' }}">
                            {{ 'offline.mall::frontend.billing_address' | trans }}
                        </a>
                        <a href="javascript:;" data-request="onChangeDefaultShippingAddress"
                           data-request-data="id: '{{ address.hashId }}'" data-request-flash
                           class="mall-switcher__item {{ __SELF__.defaultShippingAddressId == address.id ? 'mall-switcher__item--active' }}">
                            {{ 'offline.mall::frontend.shipping_address' | trans }}
                        </a>
                    </div>
                </div>
            </td>
            <td class="mall-address-list__table-actions">
                <a href="{{ __SELF__.addressPage | page({address: address.hashId, redirect: 'account'}) }}"
                   class="mall-btn mall-btn--sm">
                    {{ 'offline.mall::frontend.edit' | trans }}
                </a>
                {% if __SELF__.addresses.count > 1 %}
                    <a href="javascript:;" data-request="onDelete" data-request-data="id: '{{ address.hashId }}'"
                       data-request-confirm="{{ 'offline.mall::frontend.are_you_sure' | trans }}" data-request-flash
                       class="mall-btn mall-btn--sm">
                        {{ 'offline.mall::frontend.delete' | trans }}
                    </a>
                {% endif %}
            </td>
        </tr>
    {% endfor %}
</table>
