<?php
namespace AIAutoTool\Features\SingleAI;

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

/**
 * AI Auto Tool - Single AI Post Feature
 * 
 * @package AIAutoTool\Features\SingleAI
 * @namespace AIAutoTool\Features\SingleAI
 */

// Include the full Single AI implementation with all features
require_once dirname(__FILE__) . '/singleai.php';

// Create namespace wrapper
if (!class_exists('AIAutoTool\\Features\\SingleAI\\SingleAI')) {
    class SingleAI extends \AIAutoToolsinglepost {
        public $active_option_name = 'AIAutoToolsinglepost_active';
        public $icon = '<i class="fa-solid fa-robot"></i>';
        
        public function __construct() {
            // Ensure correct option name
            $this->active_option_name = 'AIAutoToolsinglepost_active';
            parent::__construct();
        }
        
        /**
         * Render feature for integrations page
         */
        public function render_feature() {
            // Load feature descriptions
            require_once plugin_dir_path(dirname(__FILE__)) . 'lib/feature-descriptions.php';
            
            $description = \AiAutoTool_Feature_Descriptions::get('single_ai');
            if (!$description) {
                $description = __('AI-powered single post creation with advanced features', 'ai-auto-tool');
            }
            
            $autoToolBox = new \AutoToolBox(
                esc_html__('Single AI Post', 'ai-auto-tool'),
                $description,
                "https://doc.aiautotool.com/features/single-ai",
                $this->active_option_name,
                $this->active,
                plugins_url('../../images/logo.svg', __FILE__)
            );
            
            echo $autoToolBox->generateHTML();
        }
        
        /**
         * Render tab setting - Calls parent implementation
         */
        public function render_tab_setting() {
            parent::render_tab_setting();
        }
        
        /**
         * Render settings page - Calls parent implementation
         */
        public function render_setting() {
            parent::render_setting();
        }
    }
}
