<?php
/**
 * Class Pixelio_Cart_Abandon_Recovery_More_Admin_Loader_Spinner
 *
 * Handles a loader popup in the WordPress admin.
 * Allows displaying a message with it
 *
 * @package PixelioCartAbandonRecoveryMore\Admin\Views\Reusable
 */

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_Admin_Loader_Spinner
 * *
 * * Handles a loader popup in the WordPress admin.
 * * Allows displaying a message with it
 *
 * @package PixelioCartAbandonRecoveryMore\Admin\Views\Reusable
 */
class Pixelio_Cart_Abandon_Recovery_More_Admin_Loader_Spinner
{

	/**
	 * Main text displayed in the loader.
	 *
	 * @var string
	 */
	protected $text;


	/**
	 * Constructor.
	 *
	 * Initializes the loader with text.
	 *
	 * @param string $text Main message text of the loader.
	 */
	public function __construct($text)
	{
		$this->text = $text;
	}

	/**
	 * Renders the popup HTML, CSS, and JavaScript.
	 *
	 * Handles the display of the modal dialog with two buttons, styling
	 *
	 * @return void
	 */
	public function pixelio_cart_abandon_recovery_more_get_views()
	{
		?>
		<div id="pixelio-cart-abandon-recovery-more-loader-overlay" style="display:none;">
			<div class="pixelio-cart-abandon-recovery-more-loader-box">
				<div class="pixelio-cart-abandon-recovery-more-spinner"></div>
				<p id="pixelio-cart-abandon-recovery-more-loader-text"><?php echo esc_html($this->text); ?></p>
			</div>
		</div>
		<?php
	}
}

