<?php
/**
 * Progress Bar View for Pixelio Cart Abandon Recovery More plugin.
 *
 * This file defines a reusable class for rendering a progress bar
 * in the admin pages or front-end of the Pixelio Cart Abandon Recovery More plugin.
 *
 * PHP version 8.0+
 *
 * @package PixelioCartAbandonRecoveryMore
 */

namespace PixelioCartAbandonRecoveryMore\Admin\Views\Reusable;

use PixelioCartAbandonRecoveryMore\Includes\Utils\Pixelio_Cart_Abandon_Recovery_More_Util;

if ( ! defined( 'ABSPATH' ) ) exit;

/**
 * Class Pixelio_Cart_Abandon_Recovery_More_Overlay
 *
 * Reusable class for displaying an overlay asking to get the activation key
 *
 * @package PixelioCartAbandonRecoveryMore\Admin\Views\Reusable
 */
class Pixelio_Cart_Abandon_Recovery_More_Overlay
{

	/**
	 * Constructor.
	 *
	 * Currently does not take any arguments, initialization handled in get_views().
	 */
	public function __construct()
	{
	}

	/**
	 * Outputs the HTML, CSS, and JS for a step-based progress bar.
	 *
	 * @return void
	 */
	public function pixelio_cart_abandon_recovery_more_get_views(): void
	{
		if (!get_option('pixelio_api_key')) : ?>
			<div class="pixelio-overlay">
				<div class="pixelio-overlay-content">
					<h2><?php esc_attr_e('To fully take AI & Analytics advantage, please request your free activation key first.', 'rivio-ai-cart-recovery-marketing-email-automation'); ?></h2>
					<a href="<?php echo esc_attr(Pixelio_Cart_Abandon_Recovery_More_Util::$first_config_page_url); ?>" target="_blank" class="pixelio-overlay-btn">
						<?php esc_attr_e('Get my free activation key', 'rivio-ai-cart-recovery-marketing-email-automation'); ?>
					</a>
				</div>
			</div>
		<?php endif;
	}
}
