<?php
/**
 * Mageplaza
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Mageplaza.com license that is
 * available through the world-wide-web at this URL:
 * https://www.mageplaza.com/LICENSE.txt
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade this extension to newer
 * version in the future.
 *
 * @category    Mageplaza
 * @package     Mageplaza_Osc
 * @copyright   Copyright (c) Mageplaza (https://www.mageplaza.com/)
 * @license     https://www.mageplaza.com/LICENSE.txt
 */

/** @var \Mageplaza\Osc\Block\Order\View\CustomField $block */
$data = $block->getAddressData();

if (empty($data)) {
    return;
}
?>

<?php foreach ($data as $address): ?>
    <div class="box">
        <strong class="box-title"><span><?= $block->escapeHtml($address['label']) ?></span></strong>
        <div class="box-content">
            <?php foreach ((array) $address['value'] as $field): ?>
                <div>
                    <strong><?= $block->escapeHtml($field['label']) ?>:&nbsp;</strong>
                    <span><?= $block->escapeHtml($field['value']) ?></span>
                </div>
            <?php endforeach; ?>
        </div>
    </div>
<?php endforeach; ?>

<style type="text/css">
    .block-order-additional-view .box-title {
        font-weight: 600;
    }
    .block-order-additional-view .box:nth-child(2){
        float:right;
    }
    .block-order-additional-view .box{
        width:48%
    }
    .block-order-additional-view .box:nth-child(1){
        float:left;
    }
</style>
