<?php
declare(strict_types=1);

use Magento\Framework\Escaper;
use Magento\Catalog\Helper\Output as CatalogOutputHelper;
use Magento\Catalog\Block\Product\View\Attributes;
use Magento\Catalog\Model\Product;

// phpcs:disable Magento2.Templates.ThisInTemplate.FoundHelper

/** @var Escaper $escaper */
/** @var CatalogOutputHelper $output */
/** @var Attributes $block */


/** @var CatalogOutputHelper $catalogOutputHelper */
$catalogOutputHelper = $this->helper(CatalogOutputHelper::class);

/** @var Product $product */
$product = $block->getProduct();
?>

<?php if ($attributes = $block->getAdditionalData()): ?>
    <div class="overflow-x-auto table-wrapper">
        <table class="w-full additional-attributes">
            <?php foreach ($attributes as $attribute): ?>
                <tr class="border-b border-gray-300 last:border-b-0">
                    <th class="w-1/2 py-2 font-normal text-left text-gray-700 col label"
                        scope="row"><?= $escaper->escapeHtml($attribute['label']) ?></th>
                    <td class="w-1/2 py-2 pl-2 text-left text-gray-900 col data"
                        data-th="<?= $escaper->escapeHtmlAttr($attribute['label']) ?>"
                    ><?= /* @noEscape */
                     $catalogOutputHelper->productAttribute($product, $attribute['value'], $attribute['code']) ?></td>
                </tr>
            <?php endforeach; ?>
        </table>
    </div>
<?php endif;?>
