<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/**
 * @var \Magento\AdvancedSearch\Block\SearchData $block
 */
?>
<?php
/** @var \Magento\Search\Model\QueryResult[] $data */
$data = $block->getItems();
if (count($data)) : ?>
    <div class="block search-suggestions">
        <div class="title"><?= $block->escapeHtml(__($block->getTitle())) ?></div>
        <ul>
            <?php foreach ($data as $additionalInfo) : ?>
                <li class="item">
                    <a href="<?= $block->escapeUrl($block->getLink($additionalInfo->getQueryText())) ?>"
                        ><?= $block->escapeHtml($additionalInfo->getQueryText()) ?></a>
                    <?php if ($block->isShowResultsCount()) : ?>
                        <span class="count"><?= /* @noEscape */ (int)$additionalInfo->getResultsCount() ?></span>
                    <?php endif; ?>
                </li>
            <?php endforeach; ?>
        </ul>
    </div>
<?php endif; ?>
