<?php
/**
 * Mhub_Notices Class
 *
 * Handles admin notices for the Meeting Hub plugin.
 *
 * @package SOVLIX\MHUB\Admin
 */

namespace SOVLIX\MHUB\Admin;

/**
 * Class Mhub_Notices
 *
 * Responsible for displaying and managing admin notices.
 */
class Mhub_Notices {

	/**
	 * Mhub_Notices constructor.
	 */
	public function __construct() {
		add_action( 'admin_notices', array( $this, 'display_admin_notices' ) );
	}

	/**
	 * Display admin notices based on settings and requirements.
	 */
	public function display_admin_notices() {
		// notices are now handled in React
	}

	/**
	 * Display Microsoft Teams auth notice.
	 */
	public function display_msteams_auth_notice() {
		?>
		<div class="notice notice-warning is-dismissible">
			<p>
				<?php esc_html_e( 'Please configure the Microsoft Teams Auth credentials to enable Microsoft Teams meetings. ', 'meetinghub' ); ?>
				<a href="<?php echo esc_url( admin_url( 'admin.php?page=meetinghub-settings#/msteams' ) ); ?>"><?php esc_html_e( 'Configure MS Teams Settings', 'meetinghub' ); ?></a>
			</p>
		</div>
		<?php
	}

	/**
	 * Display Microsoft Teams connect notice.
	 */
	public function display_msteams_connect_notice() {
		?>
		<div class="notice notice-info is-dismissible">
			<p>
				<?php esc_html_e( 'Microsoft Teams credentials are configured. Please connect your account to start creating meetings. ', 'meetinghub' ); ?>
				<a href="<?php echo esc_url( admin_url( 'admin.php?page=meetinghub-settings#/msteams' ) ); ?>"><?php esc_html_e( 'Connect MS Teams Account', 'meetinghub' ); ?></a>
			</p>
		</div>
		<?php
	}

	/**
	 * Display Zoom SDK notice.
	 */
	public function display_sdk_notice() {
		?>
		<div class="notice notice-warning is-dismissible">
			<p>
				<?php esc_html_e( 'Please configure the Zoom Meeting SDK to enable additional Zoom Client functionalities and ensure "Join In Browser" functionality works correctly. ', 'meetinghub' ); ?>
				<a href="<?php echo esc_url( admin_url( 'admin.php?page=meetinghub-settings#/zoom' ) ); ?>" ><?php esc_html_e( 'Configure Zoom SDK Settings', 'meetinghub' ); ?></a>
			</p>
		</div>
		<?php
	}

	/**
	 * Display Webex auth notice.
	 */
	public function display_webex_auth_notice() {
		?>
		<div class="notice notice-warning is-dismissible">
			<p>
				<?php esc_html_e( 'Please configure the Webex Auth credentials to enable Webex meetings. ', 'meetinghub' ); ?>
				<a href="<?php echo esc_url( admin_url( 'admin.php?page=meetinghub-settings#/webex' ) ); ?>"><?php esc_html_e( 'Configure Webex Settings', 'meetinghub' ); ?></a>
			</p>
		</div>
		<?php
	}

	/**
	 * Display Webex connect notice.
	 */
	public function display_webex_connect_notice() {
		?>
		<div class="notice notice-info is-dismissible">
			<p>
				<?php esc_html_e( 'Webex credentials are configured. Please connect your account to start creating meetings. ', 'meetinghub' ); ?>
				<a href="<?php echo esc_url( admin_url( 'admin.php?page=meetinghub-settings#/webex' ) ); ?>"><?php esc_html_e( 'Connect Webex Account', 'meetinghub' ); ?></a>
			</p>
		</div>
		<?php
	}

	/**
	 * Display Server to Server OAuth notice.
	 */
	public function display_auth_notice() {
		?>
		<div class="notice notice-warning is-dismissible">
			<p>
				<?php esc_html_e( 'Please configure Server to Server OAuth Credentials to enable the creation of Zoom meetings and webinars.', 'meetinghub' ); ?>
				<a href="<?php echo esc_url( admin_url( 'admin.php?page=meetinghub-settings#/zoom' ) ); ?>"><?php esc_html_e( 'Configure OAuth Credentials', 'meetinghub' ); ?></a>
			</p>
		</div>
		<?php
	}

	/**
	 * Display Zoom connect notice.
	 */
	public function display_zoom_connect_notice() {
		?>
		<div class="notice notice-info is-dismissible">
			<p>
				<?php esc_html_e( 'Zoom OAuth credentials are configured. Please ensure your token is active to create meetings. ', 'meetinghub' ); ?>
				<a href="<?php echo esc_url( admin_url( 'admin.php?page=meetinghub-settings#/zoom' ) ); ?>"><?php esc_html_e( 'Check Zoom Connection', 'meetinghub' ); ?></a>
			</p>
		</div>
		<?php
	}

	/**
	 * Display Google Meet auth notice.
	 */
	public function display_google_meet_auth_notice() {
		?>
		<div class="notice notice-warning is-dismissible">
			<p>
				<?php esc_html_e( 'Please upload the Google Meet credential JSON file to enable Google Meet meetings. ', 'meetinghub' ); ?>
				<a href="<?php echo esc_url( admin_url( 'admin.php?page=meetinghub-settings#/google-meet' ) ); ?>"><?php esc_html_e( 'Configure Google Meet Settings', 'meetinghub' ); ?></a>
			</p>
		</div>
		<?php
	}

	/**
	 * Display Google Meet connect notice.
	 */
	public function display_google_meet_connect_notice() {
		?>
		<div class="notice notice-info is-dismissible">
			<p>
				<?php esc_html_e( 'Google Meet credentials are loaded. Please permit your account to start creating meetings. ', 'meetinghub' ); ?>
				<a href="<?php echo esc_url( admin_url( 'admin.php?page=meetinghub-settings#/google-meet' ) ); ?>"><?php esc_html_e( 'Connect Google Meet Account', 'meetinghub' ); ?></a>
			</p>
		</div>
		<?php
	}
}
