<?php
/**
 * Hyvä Themes - https://hyva.io
 * Copyright © Hyvä Themes 2020-present. All rights reserved.
 * This product is licensed per Magento install
 * See https://hyva.io/license
 */

use Magento\Framework\Escaper;
use Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Comment;
use Magento\Wishlist\Helper\Data as WishlistHelper;
use Magento\Wishlist\Model\Item;

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

/** @var Escaper $escaper */
/** @var Comment $block  */

/** @var Item $item */
$item = $block->getItem();

$wishlistHelper = $this->helper(WishlistHelper::class);
?>
<div class="field comment-box hidden">
    <label class="label" for="product-item-comment-<?= $escaper->escapeHtmlAttr($item->getWishlistItemId()) ?>">
        <span><?= $escaper->escapeHtml(__('Comment')) ?></span>
    </label>
    <div class="control">
        <textarea id="product-item-comment-<?= $escaper->escapeHtmlAttr($item->getWishlistItemId()) ?>"
                  placeholder="<?= /* @noEscape */ $wishlistHelper->defaultCommentString() ?>"
                  name="description[<?= $escaper->escapeHtmlAttr($item->getWishlistItemId()) ?>]"
                  title="<?= $escaper->escapeHtmlAttr(__('Comment')) ?>"
                  class="product-item-comment form-textarea mt-1 block w-full"
            <?= $item->getProduct()->isSaleable() ? '' : 'disabled' ?>
        ><?= ($escaper->escapeHtml($item->getDescription())) ?></textarea>
    </div>
</div>
