<?php
/**
 * Mageplaza
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Mageplaza.com license that is
 * available through the world-wide-web at this URL:
 * https://www.mageplaza.com/LICENSE.txt
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade this extension to newer
 * version in the future.
 *
 * @category    Mageplaza
 * @package     Mageplaza_Faqs
 * @copyright   Copyright (c) Mageplaza (https://www.mageplaza.com/)
 * @license     https://www.mageplaza.com/LICENSE.txt
 */

use Mageplaza\Faqs\Block\Link\Footer;
use Mageplaza\Faqs\Helper\Data;
use Mageplaza\Faqs\Model\Config\Source\System\LinkPosition;

/** @var Footer $block */
/** @var Data $helper */
$helper = $block->getHelperData();
?>

<?php if ($helper->isEnabled() && $helper->getFaqsPageConfig('route') && $helper->isEnabledFaqsPage()) : ?>
    <?php if (strpos($helper->getFaqsPageConfig('link'), (string) LinkPosition::FOOTERLINK) !== false) :
        if ($block->isCurrent()) : ?>
            <li>
                <strong>
                    <?= $block->escapeHtml($block->getLabel()); ?>
                </strong>
            </li>
        <?php else : ?>
            <li>
                <a <?= /** noEscape */ $block->getLinkAttributes() ?>>
                    <?= $block->escapeHtml($block->getLabel()) ?>
                    <?= ($block->getCounter()) ? '<span>' . $block->escapeHtml($block->getCounter()) . '</span>' : '' ?>
                </a>
            </li>
        <?php endif;
    endif; ?>
<?php endif; ?>
