<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
 * Provides the admin area view for the dashboard widget.
 *
 * This file is used to markup the admin-facing aspects of the plugin's
 * dashboard widget.
 *
 * @link       https://trynbuy.edubrazeal.com/
 * @since      1.0.0
 *
 * @package    Ai_Try_N_Buy
 * @subpackage Ai_Try_N_Buy/admin/views
 *
 * Variables made available by the calling method in class-loader.php:
 * @var      array    $activation_status    The activation status data.
 * @var      int      $record_count         The total count of tracked events.
 */

?>
<div class="aitnb-widget">
	<?php if ( $activation_status && 'success' === $activation_status['status'] ) : ?>
	<p class="aitnb-widget-status-success">&#10003; <?php esc_html_e( 'Plugin Active', 'virtual-ai-fit-and-style-assistant' ); ?></p>
	<p><small><?php esc_html_e( 'Version:', 'virtual-ai-fit-and-style-assistant' ); ?> <?php echo esc_html( $activation_status['version'] ); ?></small></p>
	<p><?php esc_html_e( 'Total Events Tracked:', 'virtual-ai-fit-and-style-assistant' ); ?> <strong><?php echo esc_html( $record_count ); ?></strong></p>
	<p><a href="<?php echo esc_url( admin_url( 'admin.php?page=aitnb-analytics' ) ); ?>" class="button button-primary"><?php esc_html_e( 'View Analytics', 'virtual-ai-fit-and-style-assistant' ); ?></a></p>
	<?php elseif ( $activation_status && 'error' === $activation_status['status'] ) : ?>
	<p class="aitnb-widget-status-error">&#10007; <?php esc_html_e( 'Activation Issues Detected', 'virtual-ai-fit-and-style-assistant' ); ?></p>
		<?php if ( ! empty( $activation_status['issues'] ) ) : ?>
			<ul class="aitnb-widget-issues-list">
				<?php foreach ( $activation_status['issues'] as $issue ) : ?>
					<li class="aitnb-widget-issue-item"><?php echo esc_html( $issue ); ?></li>
				<?php endforeach; ?>
			</ul>
		<?php endif; ?>
	<p><a href="<?php echo esc_url( admin_url( 'plugins.php' ) ); ?>" class="button"><?php esc_html_e( 'Reactivate Plugin', 'virtual-ai-fit-and-style-assistant' ); ?></a></p>
	<?php else : ?>
	<p class="aitnb-widget-status-unknown">&#9888; <?php esc_html_e( 'Status Unknown', 'virtual-ai-fit-and-style-assistant' ); ?></p>
	<p><?php esc_html_e( 'Please deactivate and reactivate the plugin.', 'virtual-ai-fit-and-style-assistant' ); ?></p>
	<?php endif; ?>
</div>