<?php
/**
 * Webkul Software.
 *
 * @category   Webkul
 * @package    Webkul_Agorae
 * @author     Webkul Software Private Limited
 * @copyright  Copyright (c) Webkul Software Private Limited (https://webkul.com)
 * @license    https://store.webkul.com/license.html
 */

// @codingStandardsIgnoreFile

/**
 * Navigation menu links for customer account
 *
 * @var $block \Webkul\Marketplace\Block\Account\Navigation
 */
$viewModel = $block->getData("viewModel");
$moduleManager = $viewModel->getModuleManager();
if ($moduleManager->isOutputEnabled('Webkul_Marketplace')) {
$_helper = $this->helper('Webkul\Marketplace\Helper\Data');
$agoraeHhelper = $this->helper('Webkul\Agorae\Helper\Data');
$isPartner= $_helper->isSeller();
$magentoCurrentUrl = $block->getCurrentUrl();
$isSellerGroup = $_helper->isSellerGroupModuleInstalled();

$favouriteSellerModuleEnabled = $agoraeHhelper->isModuleEnabled('Webkul_MpFavouriteSeller');
$favouriteSellerOutputEnabled = $agoraeHhelper->isOutputEnabled('Webkul_MpFavouriteSeller');
/*Check if current customer is a seller or not*/
if ($isPartner) { ?>
<!-- if is a seller then show left link -->
    <?php if(
            (($isSellerGroup && $_helper->isAllowedAction('agorae/shopfollower/index')) || !$isSellerGroup)
            && (!$favouriteSellerModuleEnabled || !$favouriteSellerOutputEnabled)
        ) { ?>
        <li class="nav item <?php /* @escapeNotVerified */ echo strpos($magentoCurrentUrl, 'shopfollower') ? "current":"";?>">
            <?php 
            if (strpos($magentoCurrentUrl, 'shopfollower')!==false) { ?>
                <strong><?php /* @escapeNotVerified */ echo __('Shop Followers') ?></strong>
            <?php
            } else {
            ?>
                <a href="<?php /* @escapeNotVerified */ echo $block->getUrl(
                    'agorae/shopfollower/index', ['_secure' => $this->getRequest()->isSecure()]
                ); ?>">
                    <?php /* @escapeNotVerified */ echo __('Shop Followers') ?>
                </a>
            <?php
            } 
            ?>
        </li>
<?php }
}
} ?>