<?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();
$addressOsc ='';
if (empty($data)) {
    return;
}

?>

<?php foreach ($data as $address): ?>
    <?php if ($address['label']->getText() === "Billing Address"):?>
    <div class="admin__page-section-item order-billing-address">
    <?php else:?>
    <div class="admin__page-section-item order-shipping-address">
    <?php endif;?>
        <div class="admin__page-section-item-title">
            <span class="title"><?= $block->escapeHtml($address['label']) ?></span>
        </div>
        <div class="admin__page-section-item-content">
            <?php foreach ((array) $address['value'] as $field): ?>
                <div class="question">
                    <strong><?= $block->escapeHtml($field['label']) ?>:&nbsp;</strong>
                    <span><?= $block->escapeHtml($field['value']) ?></span>
                </div>
            <?php endforeach; ?>
        </div>
    </div>
<?php endforeach; ?>
