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

?>
<?php $url = $block->getReviewsUrl() . '#reviews'; ?>
<?php $urlForm = $block->getReviewsUrl() . '#review-form'; ?>
<?php if ($block->getReviewsCount()):
    $rating = $block->getRatingSummary(); ?>
<div class="product-reviews-summary<?= /*@noEscape*/ !$rating ? ' no-rating' : ''?>">
    <?php if ($rating):?>
    <div class="rating-summary">
         <span class="label"><span><?= /*@noEscape*/ __('Rating') ?>:</span></span>
         <div class="rating-result" title="<?= $block->escapeHtml($rating); ?>%">
             <span style="width:<?= $block->escapeHtml($rating); ?>%"><span><span><?=
                $block->escapeHtml($rating); ?></span>% of <span>100</span></span></span>
         </div>
     </div>
    <?php endif;?>
    <div class="reviews-actions">
        <a class="action view" href="<?= $block->escapeUrl($url) ?>"><span><?=
         $block->escapeHtml($block->getReviewsCount()) ?></span>
        <span>
        <?php if ($block->getReviewsCount() == 1) { ?>
            <?= /*@noEscape*/ __('Review') ?>
        <?php } else { ?>
            <?= /*@noEscape*/ __('Reviews') ?>
        <?php } ?></span>
        </a>
        <a class="action add" href="<?= $block->escapeUrl($urlForm) ?>"><?=
         /*@noEscape*/ __('Add Your Review') ?></a>
    </div>
</div>
<?php elseif ($block->getDisplayIfEmpty()): ?>
<div class="product-reviews-summary empty">
    <div class="reviews-actions">
        <a class="action add" href="<?= $block->escapeUrl($urlForm); ?>">
            <?= /*@noEscape*/ __('Be the first to review this product') ?>
        </a>
    </div>
</div>
<?php endif; ?>
