#include "app_config.h"
#include "app_version_info.h"
#include "app_home_page.h"
#include "app_input_pwd.h"
#include "app_main_menu.h"
#include "app_dev_set_show.h"
#include "app_dev_set.h"
#include "app_real_time_data.h"
#include "app_fix_set.h"
#include "app_fix_show.h"
#include "app_debugset.h"
#include "app_history_report.h"

// 3. 静态映射数组：集中管理所有页面的事件处理函数
const PageEventMap g_page_event_map[] = {
    {PAGE_HOME_PAGE, app_home_page_handle_event},
    {PAGE_MAIN_MENU, app_main_menu_handle_event},
    {PAGE_DEV_INFO, app_version_info_handle_event},
    {PAGE_DEV_SET_SHOW, app_dev_set_show_handle_event},
    {PAGE_DEV_SET, app_dev_set_handle_event},
    {PAGE_REAL_TIME_DATA , app_real_time_data_handle_event},
    {PAGE_DEV_FIX, app_fix_set_handle_event},
    {PAGE_DEV_FIX_SHOW, app_fix_show_handle_event},
    {PAGE_DEBUG_TEST, app_debugset_handle_event},
    {PAGE_HISTORY_DATA, app_history_report_handle_event},
    // 新增页面只需在这里加一行：{新页面ID, 新页面处理函数},

};

const uint8_t g_page_event_map_size = sizeof(g_page_event_map) / sizeof(PageEventMap);

/**
 * @brief 是否处于组件弹出状态
 * @return true 
 * @return false 
 * @date 2026-01-12
 */
bool  is_compenents_stats()
{
    UICursorState curState = ui_manager_get_cursor();
    if (curState.cursor_pos > CURSOR_LEFT_MENU)
    {
        return true;
    }
    
    return false;
}