#pragma once

#include "UIConstants.hpp"
#include <SDL.h>
#include <SDL_ttf.h>
#include <string>

namespace GModTeach {
namespace UI {

class Button {
public:
    Button(SDL_Rect bounds, std::string label);

    void UpdateHover(int mouseX, int mouseY);
    [[nodiscard]] bool IsHovered() const { return m_hovered; }
    [[nodiscard]] bool Contains(int mouseX, int mouseY) const;

    void SetEnabled(bool enabled) { m_enabled = enabled; }
    [[nodiscard]] bool IsEnabled() const { return m_enabled; }

    void SetLabel(const std::string& label) { m_label = label; }
    [[nodiscard]] const std::string& GetLabel() const { return m_label; }

    void Draw(SDL_Renderer* renderer, TTF_Font* font) const;

private:
    SDL_Rect m_bounds;
    std::string m_label;
    bool m_hovered = false;
    bool m_enabled = true;
};

} 
} 
