#ifndef _UI_MAIN_MENU_H
#define _UI_MAIN_MENU_H

#include "../ui_config.h"
#include <stdint.h>
#include <stdbool.h>

#define UI_MAIN_MENU_NUM 8

typedef enum {
    UI_MAIN_MENU_DEV_SET = 0,
    UI_MAIN_MENU_DEV_FIX,
    UI_MAIN_MENU_DEV_SET_SHOW,
    UI_MAIN_MENU_DEV_FIX_SHOW,
    UI_MAIN_MENU_REAL_TIME_DATA,
    UI_MAIN_MENU_HISTORY_DATA,
    UI_MAIN_MENU_DEBUG_TEST,
    UI_MAIN_MENU_VERSION_INFO,
} UIMainMenuType;

typedef struct {
    const char *name;
    bool need_password;
    UIMainMenuType type;
} UIMainMenuItemConfig;

typedef struct {
    UIMainMenuItemConfig items[UI_MAIN_MENU_NUM];
    uint8_t selected_idx;
} UIMainMenuConfig;

void ui_main_menu_create(const UIMainMenuConfig *config);

void ui_main_menu_refresh(uint8_t selected_idx);

void ui_main_menu_destroy(void);

void ui_main_menu_record_type(UIMainMenuType type);

UIMainMenuType ui_main_menu_get_type(void);

void ui_main_menu_config_convert(UIMainMenuConfig *ui_config, const void *service_config);

#endif /* _UI_MAIN_MENU_H */
