<?php
/**
 * Copyright 2017 Adobe
 * All Rights Reserved.
 */

/** @var \Magento\Customer\Block\Address\Book $block */
/** @var \Magento\Framework\Escaper $escaper */
?>
<div class="block block-addresses-default">
    <div class="block-title"><strong><?= $escaper->escapeHtml(__('Default Addresses')) ?></strong></div>
    <div class="block-content">
        <?php if ($defaultBillingAddress = $block->getDefaultBilling()): ?>
            <div class="box box-address-billing">
                <strong class="box-title">
                    <span><?= $escaper->escapeHtml(__('Default Billing Address')) ?></span>
                </strong>
                <div class="box-content">
                    <address>
                        <?= $block->getAddressHtml($block->getAddressById($defaultBillingAddress)) ?>
                    </address>
                </div>
                <div class="box-actions">
                    <a class="action edit"
                       href="<?= $escaper->escapeUrl($block->getAddressEditUrl($defaultBillingAddress)) ?>">
                        <span><?= $escaper->escapeHtml(__('Change Billing Address')) ?></span>
                    </a>
                </div>
            </div>
        <?php else: ?>
            <div class="box box-billing-address">
                <strong class="box-title">
                    <span><?= $escaper->escapeHtml(__('Default Billing Address')) ?></span>
                </strong>
                <div class="box-content">
                    <p><?= $escaper->escapeHtml(__('You have no default billing address in your address book.')) ?></p>
                </div>
            </div>
        <?php endif ?>

        <?php if ($defaultShippingAddress = $block->getDefaultShipping()): ?>
            <div class="box box-address-shipping">
                <strong class="box-title">
                    <span><?= $escaper->escapeHtml(__('Default Shipping Address')) ?></span>
                </strong>
                <div class="box-content">
                    <address>
                        <?= $block->getAddressHtml($block->getAddressById($defaultShippingAddress)) ?>
                    </address>
                </div>
                <div class="box-actions">
                    <a class="action edit"
                       href="<?= $escaper->escapeUrl($block->getAddressEditUrl($defaultShippingAddress)) ?>">
                        <span><?= $escaper->escapeHtml(__('Change Shipping Address')) ?></span>
                    </a>
                </div>
            </div>
        <?php else: ?>
            <div class="box box-shipping-address">
                <strong class="box-title">
                    <span><?= $escaper->escapeHtml(__('Default Shipping Address')) ?></span>
                </strong>
                <div class="box-content">
                    <p><?= $escaper->escapeHtml(__('You have no default shipping address in your address book.')) ?></p>
                </div>
            </div>
        <?php endif ?>
    </div>
</div>
