<?php
/**
 * Blog post next and prev post links
 *
 * @var $block NextPrev
 *
 * @category    Olegnax
 * @package     Olegnax_Athlete2
 * @copyright   Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
 * @license     https://www.olegnax.com/license
 */

use Magefan\Blog\Block\Post\View\NextPrev;

?>

<?php if ($block->displayLinks()) { ?>
    <?php
        $prevPost = $this->getPrevPost();
        $nextPost = $this->getNextPost();
    ?>
    <?php if ($prevPost || $nextPost) { ?>
        <div class="post-nextprev-hld clearfix">
            <?php if ($prevPost) { ?>
                <?php $title = $block->escapeHtml($prevPost->getTitle()) ?>
					<a class="nextprev-link prev-link" href="<?php echo $block->escapeUrl($prevPost->getPostUrl()) ?>" title="<?php echo __('Read %1',$title) ?>">
						<span class="h6 label"><?php echo __('Previous') ?></span>
						<span class="h3"><span><?php echo $title ?></span></span>
					</a>
            <?php } ?>
            <?php if ($nextPost) { ?>
                <?php $title = $block->escapeHtml($nextPost->getTitle()) ?>
                <a class="nextprev-link next-link" href="<?php echo $block->escapeUrl($nextPost->getPostUrl()) ?>" title="<?php echo __('Read %1',$title) ?>">
                    <span class="h6 label"><?php echo __('Next') ?></span>
					<span class="h3"><span><?php echo $title ?></span></span>
                </a>
            <?php } ?>
        </div>
    <?php } ?>
<?php } ?>
