<?php
/**
 * MagePrince
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the mageprince.com license that is
 * available through the world-wide-web at this URL:
 * https://mageprince.com/end-user-license-agreement
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade this extension to newer
 * version in the future.
 *
 * @category    MagePrince
 * @package     Mageprince_Faq
 * @copyright   Copyright (c) MagePrince (https://mageprince.com/)
 * @license     https://mageprince.com/end-user-license-agreement
 */
?>
<?php
/** @var $block \Mageprince\Faq\Block\Index\Index */
$faqGroupCollection = $block->getFaqGroupCollection();
$faqCollection = $block->getFaqCollection($block->getGroupId());
$group = $block->getGroupById($block->getGroupId());
?>
<?php if ($block->isShowGroupTitle()): ?>
    <div class="group-title" id="group<?= $block->escapeHtmlAttr($group->getFaqGroupId()); ?>">
        <?= $block->escapeHtml($group->getGroupName()); ?>
    </div>
<?php endif; ?>
<div class="faq-accordion">
    <?php $faqCollection = $block->getFaqCollection($group->getId()); ?>
    <?php if ($faqCollection->getSize()): ?>
        <?php foreach ($faqCollection as $faq): ?>
            <h3><?= $block->escapeHtml($faq->getTitle()); ?></h3>
            <div>
                <p><?= /* @noEscape */ $block->filterOutputHtml($faq->getContent()); ?></p>
            </div>
        <?php endforeach; ?>
    <?php endif; ?>
</div>
