<?php

/**
 * Admin Class.
 *
 * @package Kubelio\Admin
 * @since 1.0.0
 */

namespace Kubelio\Admin;

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

/**
 * Admin Class
 */
class Setup {

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts'));
	}

	/**
	 * Admin enqueue script
	 */
	public function enqueue_scripts() {
		wp_enqueue_style('kubelio-admin', get_template_directory_uri() . '/assets/css/admin/admin.min.css', array(), KUBELIO_THEME_VERSION);
		wp_enqueue_script('kubelio-admin', get_template_directory_uri() . '/assets/js/admin.min.js', array('jquery'), KUBELIO_THEME_VERSION, true);

		wp_localize_script('kubelio-admin', 'kubelioAdminParams', array(
			'ajax_url'      => admin_url('admin-ajax.php'),
			'nonce'         => wp_create_nonce('kubelio_admin_nonce'),
			'images_url'    => get_template_directory_uri() . '/assets/images',
			'dashboard_url' => get_theme_mod('demo_imported') ? admin_url('admin.php?page=kubelio-panel') : admin_url('admin.php?page=kubelio-setup'),
		));
	}
}
