#ifndef DASHBOARD_UI_H
#define DASHBOARD_UI_H

#include "ws_client.h"
#include "lvgl.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Create the full dashboard UI. Must be called with LVGL lock held.
 */
void dashboard_ui_create(void);

/**
 * Update Pi server stats display. LVGL lock must be held by caller.
 */
void dashboard_ui_update_stats(const pi_stats_t *stats);

/**
 * Update local sensor readings. LVGL lock must be held by caller.
 */
void dashboard_ui_update_local(float temp, float humidity, uint8_t battery, bool charging, float voltage);

/**
 * Update clock and date display. LVGL lock must be held by caller.
 * weekday: 0=Sun, 1=Mon, ..., 6=Sat
 */
void dashboard_ui_update_time(int h, int m, int s, int year, int month, int day, int weekday);

/**
 * Update connection status indicators. LVGL lock must be held by caller.
 * ip_str: IP address string when connected, "Connecting..." during reconnect, "N/A" when disconnected
 */
void dashboard_ui_update_connection(ws_state_t ws_state, bool wifi_connected, const char *ip_str);

/**
 * Update the status image widget. LVGL lock must be held by caller.
 * @param dsc  Image descriptor (1-bit monochrome, 120x120)
 */
void dashboard_ui_update_status_image(const lv_img_dsc_t *dsc);

#ifdef __cplusplus
}
#endif

#endif
