<?php
namespace AIAutoTool\Features\KeywordAutopost;

if ( ! defined( 'ABSPATH' ) ) exit; // Thoát nếu truy cập trực tiếp

/**
 * AI Auto Tool - Keyword Auto Post Feature
 * 
 * @package AIAutoTool\Features\KeywordAutopost
 * @namespace AIAutoTool\Features\KeywordAutopost
 */

// Include the original Keyword_Autopost_Plugin
require_once dirname(__FILE__) . '/keyword-autopost-original.php';

// Create namespace wrapper
if (!class_exists('AIAutoTool\\Features\\KeywordAutopost\\KeywordAutopost')) {
    class KeywordAutopost extends \Keyword_Autopost_Plugin {
        public $active_option_name = 'aiautotool_keyword_autopost_active';
        public $icon = '<i class="fa-solid fa-key"></i>';
        
        public function __construct() {
            parent::__construct();
        }
        
        /**
         * Render feature for integrations page
         */
        public function render_feature() {
            // Load feature descriptions only if not already loaded
            if (!class_exists('\\AiAutoTool_Feature_Descriptions')) {
                require_once plugin_dir_path(dirname(dirname(dirname(__FILE__)))) . 'lib/feature-descriptions.php';
            }
            
            $box = new \AutoToolBox(
                $this->icon . ' ' . esc_html__('Keyword Autopost AI post','ai-auto-tool'),
                \AiAutoTool_Feature_Descriptions::get('keyword_autopost'),
                "https://doc.aiautotool.com/integrations/keyword-autopost-guide",
                $this->active_option_name,
                $this->active,
                plugins_url('../../images/logo.svg', __FILE__)
            );
            
            echo $box->generateHTML();
        }
    }
}

