#include "display/ui/components/steps_strip.h"

#include "display/ui/components/primitives.h"
#include "display/ui/theme.h"

LV_FONT_DECLARE(lv_font_home_22)

namespace hwdisplay::ui::components {

bool StepsStrip::Create(lv_obj_t* parent, int x, int y, int w, int h) {
    root_ = Box(parent, x, y, w, h, theme::kWhite, 18);
    if (!root_) return false;
    const char* labels[4] = {"湿手", "打泡泡", "搓一搓", "冲净擦干"};
    for (int i = 0; i < 4; ++i) {
        const int sx = 21 + i * 178;
        if (!Box(root_, sx, 13, 30, 30, 0xE1F7F2, LV_RADIUS_CIRCLE)) return false;
        char number[2] = {(char)('1' + i), '\0'};
        if (!Text(root_, sx + 9, 17, number, &lv_font_home_22, 0x148D85)) return false;
        if (!Text(root_, sx + 39, 16, labels[i], &lv_font_home_22, 0x426C76)) return false;
        if (i < 3 && !Text(root_, sx + 150, 15, ">", &lv_font_home_22, 0x9ABDBB)) return false;
    }
    return true;
}

}  // namespace hwdisplay::ui::components
