<?php
namespace WTC_CHECKOUT\Core;
use WTC_CHECKOUT\Core\General\GeneralSettings;
use WTC_CHECKOUT\Modules\Forms\Admin\FieldLayoutSettings;
use WTC_CHECKOUT\Modules\Contracts\Admin\ContractsSettings;
use WTC_CHECKOUT\Modules\Coupons\Admin\CouponSettings;
use WTC_CHECKOUT\Modules\Dashboard\Admin\DashboardSettings;
use WTC_CHECKOUT\Modules\Cargo\Admin\CargoSettings;
use WTC_CHECKOUT\Modules\SMS\Admin\SMSSettings;
use WTC_CHECKOUT\Modules\Refund\Admin\RefundSettings;
use WTC_CHECKOUT\Modules\OTP\Admin\OTPSettings;
use WTC_CHECKOUT\Modules\Points\Admin\PointsSettings;
defined('ABSPATH') || exit;
class MenuManager {
    private $page_slug = 'wtc-general-settings';
    public function __construct() {
        add_action('admin_menu', array($this, 'register_menus'));
    }
    public function register_menus() {
        add_menu_page(
            __('WTC Ayarları', 'wtc-checkout'),
            'WTC',
            'manage_woocommerce',
            $this->page_slug,
            null,
            'dashicons-cart',
            56 
        );
        $this->add_submenu_pages();
    }
    private function add_submenu_pages() {
        add_submenu_page(
            $this->page_slug,
            __('Genel Ayarlar', 'wtc-checkout'),
            __('Genel Ayarlar', 'wtc-checkout'),
            'manage_woocommerce',
            'wtc-general-settings',
            array(new GeneralSettings(), 'render_settings_page')
        );
        add_submenu_page(
            $this->page_slug,
            __('Sözleşmeler', 'wtc-checkout'),
            __('Sözleşmeler', 'wtc-checkout'),
            'manage_woocommerce',
            'wtc-contracts',
            array(new ContractsSettings(), 'render_settings_page')
        );
        add_submenu_page(
            $this->page_slug,
            __('Kupon Yönetimi', 'wtc-checkout'),
            __('Kupon Yönetimi', 'wtc-checkout'),
            'manage_woocommerce',
            'wtc-coupon',
            array(new CouponSettings(), 'render_settings_page')
        );
        add_submenu_page(
            $this->page_slug,
            __('Kullanıcı Paneli', 'wtc-checkout'),
            __('Kullanıcı Paneli', 'wtc-checkout'),
            'manage_woocommerce',
            'wtc-dashboard',
            array(new DashboardSettings(), 'render_settings_page')
        );
        add_submenu_page(
            $this->page_slug,
            __('Alan Düzenleri', 'wtc-checkout'),
            __('Alan Düzenleri ⭐', 'wtc-checkout'),
            'manage_woocommerce',
            'wtc-layouts',
            array(new FieldLayoutSettings(), 'render_settings_page')
        );
        add_submenu_page(
            $this->page_slug,
            __('Kargo Takip', 'wtc-checkout'),
            __('Kargo Takip ⭐', 'wtc-checkout'),
            'manage_woocommerce',
            'wtc-cargo',
            array(new CargoSettings(), 'render_settings_page')
        );
        add_submenu_page(
            $this->page_slug,
            __('SMS Gönderimi', 'wtc-checkout'),
            __('SMS Gönderimi ⭐', 'wtc-checkout'),
            'manage_woocommerce',
            'wtc-sms',
            array(new SMSSettings(), 'render_settings_page')
        );
        add_submenu_page(
            $this->page_slug,
            __('İade Yönetimi', 'wtc-checkout'),
            __('İade Yönetimi ⭐', 'wtc-checkout'),
            'manage_woocommerce',
            'wtc-refund',
            array(new RefundSettings(), 'render_settings_page')
        );
        add_submenu_page(
            $this->page_slug,
            __('OTP Doğrulama', 'wtc-checkout'),
            __('OTP Doğrulama ⭐', 'wtc-checkout'),
            'manage_woocommerce',
            'wtc-otp',
            array(new OTPSettings(), 'render_settings_page')
        );
        add_submenu_page(
            $this->page_slug,
            __('Puan Yönetimi', 'wtc-checkout'),
            __('Puan Yönetimi ⭐', 'wtc-checkout'),
            'manage_woocommerce',
            'wtc-points',
            array(new PointsSettings(), 'render_settings_page')
        );
    }
} 