<?php

/**
 * Plugin Requirement Notice View
 *
 * @package kubelio
 */

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

$is_installed    = $args['is_installed'] ?? false;
$action_url      = $args['action_url'] ?? '';
?>

<div class="notice notice-warning rta-notice is-dismissible">
	<div class="rta-notice__logo">
		<img src="<?php echo esc_url(get_template_directory_uri() . '/assets/images/pavicon.webp'); ?>" alt="Kubelio">
	</div>
	<div class="rta-notice__body">
		<div class="rta-notice__header">
			<div class="rta-notice__title"><?php esc_html_e('Welcome to Kubelio Theme', 'kubelio'); ?></div>
		</div>
		<div class="rta-notice__content">

			<?php if ($is_installed) : ?>
				<p><?php esc_html_e('The Kubelio Companion plugin is already installed on your website, but it is currently not activated. This plugin is essential to ensure all theme features run smoothly.', 'kubelio'); ?></p>
			<?php else : ?>
				<p><?php esc_html_e('To unlock essential features like theme settings and custom blocks, the Kubelio theme requires the Kubelio Companion plugin. Please install it to get the best experience.', 'kubelio'); ?></p>
			<?php endif; ?>
		</div>
		<div class="rta-notice__actions">
			<a href="<?php echo esc_url($action_url); ?>" class="button button-primary js-plugin-required-install" data-action="<?php echo esc_attr($is_installed ? 'kubelio_activate_plugin' : 'kubelio_install_plugin'); ?>">
				<?php
				if ($is_installed) {
					esc_html_e('Activate Kubelio Companion', 'kubelio');
				} else {
					esc_html_e('Install Kubelio Companion', 'kubelio');
				}
				?>
			</a>

			<a href="https://kubelio.com/installation-guide" target="_blank" class="button button-secondary" style="margin-left: 8px; border-radius: 8px;">
				<?php esc_html_e('Installation Guide', 'kubelio'); ?>
			</a>
		</div>
	</div>
</div>