<?php

namespace SWPanel;

defined('ABSPATH') || die('No direct access.');

class AdminMenu {
    public function __construct() {
        add_action('admin_menu', [$this, 'register']);
    }


    public function register() {
        add_menu_page(
            __('SWPanel', 'swpanel-ai'),
            __('SWPanel AI Builder', 'swpanel-ai'),
            'manage_options',
            'swpanel_ai',
            [$this, 'render'],
            plugin_dir_url(__FILE__).'assets/img/logo_menu.svg',
            0
        );
    }

    public function render() {
        $license_data = get_transient('swpanel_ai_license_status', 0);
        if(!get_option('swpanel_ai_license_token_entered')) {
            $license_data = 2;
        }
        include SWPANEL_PATH . 'admin/views/admin-menu.php';
    }
}
