<?php
// phpcs:disable Magento2.Templates.ThisInTemplate

/** @var $block \Magento\Sales\Block\Order\Email\Items */
?>
<?php $_order = $block->getOrder() ?>
<?php if ($_order) : ?>
    <?php $_items = $_order->getAllItems(); ?>
    <table class="email-items">
        <thead>
        <tr>
            <th class="item-info">

            </th>
            <th class="item-qty">
                <?= $block->escapeHtml(__('Item')) ?>
            </th>
            <th class="item-price">
                <?= $block->escapeHtml(__('Qty')) ?>
            </th>
            <th class="item-price" style="text-align:right;">
                <?= $block->escapeHtml(__('Price')) ?>
            </th>
        </tr>
        </thead>
        <?php foreach ($_items as $_item) : ?>
            <?php if (!$_item->getParentItem()) : ?>
                <tbody>
                <?= $block->getItemHtml($_item) ?>
                </tbody>
            <?php endif; ?>
        <?php endforeach; ?>

    </table>
    <?php if ($this->helper(\Magento\GiftMessage\Helper\Message::class)
            ->isMessagesAllowed('order', $_order, $_order->getStore())
        && $_order->getGiftMessageId()
    ) : ?>
        <?php $_giftMessage = $this->helper(\Magento\GiftMessage\Helper\Message::class)
            ->getGiftMessage($_order->getGiftMessageId()); ?>
        <?php if ($_giftMessage) : ?>
            <br />
            <table class="message-gift">
                <tr>
                    <td>
                        <h3><?= $block->escapeHtml(__('Gift Message for this Order')) ?></h3>
                        <strong><?= $block->escapeHtml(__('From:')) ?></strong> <?= $block->escapeHtml($_giftMessage->getSender()) ?>
                        <br /><strong><?= $block->escapeHtml(__('To:')) ?></strong> <?= $block->escapeHtml($_giftMessage->getRecipient()) ?>
                        <br /><strong><?= $block->escapeHtml(__('Message:')) ?></strong>
                        <br /><?= $block->escapeHtml($_giftMessage->getMessage()) ?>
                    </td>
                </tr>
            </table>
        <?php endif; ?>
    <?php endif; ?>
<?php endif; ?>
<div class="preview-email-order-totals" style="margin-top: 20px">
<?= $block->getChildHtml('order_totals') ?>
</div>
