<?php
namespace AIAutoTool\Features\Autoblogging;

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

/**
 * AI Auto Tool - Autoblogging Feature
 * 
 * @package AIAutoTool\Features\Autoblogging
 * @namespace AIAutoTool\Features\Autoblogging
 */

// Include the original AI_AutoTool_Autoblogging
require_once dirname(__FILE__) . '/autoblogging-original.php';

// Create namespace wrapper
if (!class_exists('AIAutoTool\\Features\\Autoblogging\\Autoblogging')) {
    class Autoblogging extends \AI_AutoTool_Autoblogging {
        public $active_option_name = 'AI_AutoTool_Autoblogging_active';
        public $icon = '<i class="fa-solid fa-blog"></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__('Autoblogging AI post','ai-auto-tool'),
                \AiAutoTool_Feature_Descriptions::get('autoblogging'),
                "https://doc.aiautotool.com/integrations/schedule-ai-post-user-guide",
                $this->active_option_name,
                $this->active,
                plugins_url('../../images/logo.svg', __FILE__)
            );
            
            echo $box->generateHTML();
        }
    }
}

