<?php
/**
 * My Account Dashboard
 *
 * Shows the first intro screen on the account dashboard.
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/myaccount/dashboard.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @see     https://woo.com/document/template-structure/
 * @package WooCommerce\Templates
 * @version 4.4.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

$allowed_html = array(
	'a' => array(
		'href' => array(),
	),
);

$hello_text        = esc_html__( 'Welcome back, ', 'hello-wpstream' );
$current_user_name = $current_user->display_name;
$dashboard_desc    = esc_html__( 'Start your day of with some account features.', 'hello-wpstream' )
?>

<div class="wpstream-dashboard-animation-wrap">
	<?php echo wpstream_theme_get_svg_icon( 'dashboard-robot.svg' );?>
</div>

<h1 class="wpstream-dashboard-title">
	<?php echo esc_html($hello_text); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
	<span><?php echo esc_html($current_user_name); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
</h1>

<p class="wpstream-dashboard-subtitle"><?php echo esc_html($dashboard_desc); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>

<div class="wpstream-dashboard-links-wrap">
	<?php 	if (  wpstream_check_if_user_can_stream()) { ?>
		<a class="wpstream-dashboard-link-wrap type-2-button-style" href="<?php echo esc_url( wpstream_non_woo_get_account_endpoint_url( 'start-streaming' ) ); ?>">
			<div class="wpstream-dashboard-link-content">
			<?php echo wpstream_theme_get_svg_icon( 'dashboard-start-streaming.svg' );?>
			
		
			<div class="wpstream-dashboard-link-text">
				<span class="link-title"><?php esc_html_e('Start Streaming','hello-wpstream');?></span>
				<span class="link-description"><?php esc_html_e('Go live with WpStream','hello-wpstream');?></span>
			</div>
			</div>

			<div class="wpstream-dashboard-link">
				<?php echo wpstream_theme_get_svg_icon( 'dahboard-arrow.svg' );?>
			</div>
		</a>
	<?php } ?>

	<a class="wpstream-dashboard-link-wrap type-2-button-style" href="<?php echo esc_url( wc_get_endpoint_url( 'orders' ) ); ?>">
		<div class="wpstream-dashboard-link-content">

			<?php echo wpstream_theme_get_svg_icon( 'dashboard-orders.svg' );?>

			<div class="wpstream-dashboard-link-text">
				<span class="link-title"><?php esc_html_e('View orders','hello-wpstream');?></span>
				<span class="link-description"><?php esc_html_e('View recent orders','hello-wpstream');?></span>
			</div>
		</div>

		<div class="wpstream-dashboard-link">
			<?php echo wpstream_theme_get_svg_icon( 'dahboard-arrow.svg' );?>
		</div>
	</a>

	<a class="wpstream-dashboard-link-wrap type-2-button-style" href="<?php echo esc_url( wc_get_endpoint_url( 'event-list' ) ); ?>">
		<div class="wpstream-dashboard-link-content">
		<?php echo wpstream_theme_get_svg_icon( 'dashboard-videos.svg' );?>
	

			<div class="wpstream-dashboard-link-text">
				<span class="link-title"><?php esc_html_e('Purchased videos','hello-wpstream');?></span>
				<span class="link-description"><?php esc_html_e('Check the Purchased videos','hello-wpstream');?></span>
			</div>

		</div>

		<div class="wpstream-dashboard-link">
			<?php echo wpstream_theme_get_svg_icon( 'dahboard-arrow.svg' );?>
		</div>
	</a>

	<a class="wpstream-dashboard-link-wrap type-2-button-style" href="<?php echo esc_url( wc_get_endpoint_url( 'event-list' ) ); ?>">
		<div class="wpstream-dashboard-link-content">

			<?php echo wpstream_theme_get_svg_icon( 'dashboard-events.svg' );?>

			<div class="wpstream-dashboard-link-text">
				<span class="link-title"><?php esc_html_e('Purchased events','hello-wpstream');?></span>
				<span class="link-description"><?php esc_html_e('Check the Purchased Events','hello-wpstream');?></span>
			</div>
		</div>

		<div class="wpstream-dashboard-link">
			<?php echo wpstream_theme_get_svg_icon( 'dahboard-arrow.svg' );?>
		</div>
	</a>
</div>

<?php
	/**
	 * My Account dashboard.
	 *
	 * @since 2.6.0
	 */
	do_action( 'woocommerce_account_dashboard' );

	/**
	 * Deprecated woocommerce_before_my_account action.
	 *
	 * @deprecated 2.6.0
	 */
	do_action( 'woocommerce_before_my_account' );

	/**
	 * Deprecated woocommerce_after_my_account action.
	 *
	 * @deprecated 2.6.0
	 */
	do_action( 'woocommerce_after_my_account' );

/* Omit closing PHP tag at the end of PHP files to avoid "headers already sent" issues. */
