#pragma once
#include <string>
#include "ConfigValue.h"
#include <imgui.h>
#include "../gui/menu/menu.h"
#include "../util/i18n.h"

class MenuSectionValue : public ConfigValue
{
public:
    explicit MenuSectionValue(const std::string& title) : ConfigValue(title), title_(title) {}

    void set_section_active(const bool active) { section_active_ = active; }

    void draw() override
    {
        ImGui::Dummy(ImVec2(0, 6.f));
        ImGui::Separator();
        const float menu_a = ImGui::GetStyle().Alpha;
        const ImVec4 color = section_active_
            ? ImVec4(0.72f, 0.78f, 0.55f, menu_a)
            : menu::with_alpha(menu::palette::muted, 0.55f * menu_a);
        ImGui::TextColored(color, "%s", i18n::tr(title_).c_str());
        ImGui::Dummy(ImVec2(0, 2.f));
    }

    void set(const std::string&) override {}
    std::string get() override { return {}; }
    std::string get_default() override { return {}; }

private:
    std::string title_;
    bool section_active_ = true;
};