<?php
/* @var $block \Mirasvit\Rma\Block\Rma\View */
$rma = $block->getRma();
$orders = $block->getOrders();
?>
<div class="rma-view">
    <?= $block->getChildHtml('rma.view.buttons') ?>
    <?= $block->getChildHtml('rma.view.info') ?>
    <?php foreach ($orders as $order): ?>
        <?php if ($order): ?>
            <div class="">
                <div class="title">
                    <strong><?= __('Items RMA Requested for %1', $block->escapeHtml($block->getOrderLabel($order))) ?></strong>
                </div>
            </div>
            <?php
                if ($order->getIsOffline()) {
                    $itemsBlock = $block->getChildBlock('rma.view.offline.items');
                } else {
                    $itemsBlock = $block->getChildBlock('rma.view.items');
                }
                $itemsBlock->setOrder($order);
                echo $itemsBlock->toHtml();
            ?>
        <?php endif; ?>
    <?php endforeach; ?>
    <div class="block">
        <div class="block-content">
            <div class="box"><?= $block->getChildHtml('rma.view.history') ?></div>
            <div class="box"><?= $block->getChildHtml('rma.view.message') ?></div>
        </div>
    </div>


</div>