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

/** @var \Magento\Review\Block\Product\Review $block */
?>
<div class="product info detailed" id="review_information">
	<div class="product data items" role="tablist">
		<div class="data item title active" aria-labeledby="tab-label-reviews-title" data-role="collapsible" id="tab-label-reviews" role="tab" data-collapsible="true" aria-controls="reviews" aria-selected="true" aria-expanded="true" tabindex="0">
			<a class="data switch" tabindex="-1" data-toggle="switch" href="#reviews" id="tab-label-reviews-title">
            	<span><?php echo $block->escapeHtml(__('Customer Reviews')); ?></span>
			</a>
		</div>
		<div class="data item content" id="reviews" data-role="content" aria-labelledby="tab-label-reviews" role="tabpanel" aria-hidden="false" style="display: block;">
            <div id="product-review-container" data-role="product-review"></div>
            <?= $block->getChildHtml() ?>

<script type="text/x-magento-init">
    {
        "*": {
            "Magento_Review/js/process-reviews": {
                "productReviewUrl": "<?= $block->escapeJs($block->getProductReviewUrl()) ?>",
                "reviewsTabSelector": "#tab-label-reviews"
            }
        }
    }
</script>
		</div>
    </div>
</div>

<script type="text/javascript">
    require(['jquery','jquery/ui'], function($) {
    	$(document).ready(function(){
    		$('.reviews-actions a').one('click', function() { $("#review_information div.product.data.items").tabs();});
        });
    });
</script>
