<?php
namespace ShopyPress\Hooks;


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

use ShopyPress\Hooks\IHook;
use ShopyPress\Config\Config;
use ShopyPress\Views\Admin\Settings\MainSettings;

class ActionAdminMenu implements IHook {

    static function register() {
        add_action('admin_menu', [self::class, 'adminMenuHandler']);
    }

    static function adminMenuHandler(): void {
        $mainSettings = new MainSettings();
        $mainSettingsPageSlug = Config::getInstance()->getSetting('main_settings_page_slug', '');
        add_menu_page(esc_html__('SyncKube Settings', 'synckube-products-sync-for-shopify'), esc_html__('SyncKube Settings', 'synckube-products-sync-for-shopify'),
        'manage_options', $mainSettingsPageSlug, [$mainSettings, 'render'], NULL, 81);
    }
}