<?php
/**
 * Post additional content
 *
 * @package wpstream-theme
 */

global $post;
global $product;

if( function_exists('wc_get_product')){
	$product = wc_get_product();
}

$product_type = '';
if ( $product ) {
	$product_type = $product->get_type();
}
$post_type = wpstream_get_current_post_type();//phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
?>

<?php if ( 'wpstream_bundle_bck' !== $product_type ) : ?>
<div class="wpstream-single-post-bar wpstream-single-post-bar-top">
	<div class="row justify-content-between">

		<ul class="wp-stream-list d-flex flex-wrap">
            <?php if ( class_exists('Wpstream_Player') ) { ?>
			<li class="views-count">
				<?php
	                echo wpstream_theme_get_svg_icon('eye.svg');//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
				?>

				<span>
					<?php
					echo wpstream_display_post_view_count_by_id( $post->ID ) . ' ';//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped

					echo wp_kses_post( apply_filters( 'wpstream_additional_content_post_type_label', __( 'reads', 'hello-wpstream' ), $post_type ) );
					?>
			    </span>
			</li>
			<?php } ?>

			<?php 
			
		
			if ('wpstream_bundle' !== $post_type && !('product' == $post_type && 'wpstream_bundle' === $product_type)) {  ?>
				<li class="btn-hover-white meta-style">

					<?php wpstream_theme_comment_count(); ?>

				</li>

			<?php } ?>

		</ul>


		<div class="wp-stream-list wp-stream-list-right flex-wrap">

			<?php
			
			echo wpstream_theme_show_like_dislike( $post->ID );//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
		
			?>

			<div class="wp-stream-share-icon-section">
				<div class="wp-stream-share-icon btn-hover-white meta-style">

					<?php
					echo wpstream_theme_get_svg_icon( 'share.svg' );//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
					?>

					<span><?php esc_html_e( 'Share', 'hello-wpstream' ); ?></span>

				</div>

				<div class="wpstream-social-share-main meta-style">

					<?php
                    if ( class_exists('Wpstream_Player') ) {
                    echo wpstream_theme_show_social_share_page( $post->ID );//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
                    }
                    ?>

				</div>
			</div>

			<?php
			$post_type_conditions = apply_filters( 'wpstream_additional_content_post_type', array( 'product' ) );
			if ( is_single() && in_array( $post_type, $post_type_conditions, true ) ) { ?>

				<div class="wpstream-watch-later-btn">

					<?php
                   if ( class_exists('Wpstream_Player') ) {
	                   echo wpstream_theme_show_watch_later($post->ID);//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
                   }
                    ?>

				</div>
				
			<?php } ?>

		</div>

		
	</div>

</div>
<?php endif; ?>
