#ifndef CHAT_TEXT_FIELD_HPP_
#define CHAT_TEXT_FIELD_HPP_

#include <Entity/PhysicsEntity/CameraEntity/Player/Player.hpp>
#include <Widget/TextField/TextField.hpp>

/**
 * A text field with support for navigating history using up/down keys.
 */
class ChatTextField : public TextField
{
private:
    std::vector<std::string> &fieldHistory;
    int historyIndex;
    Uint32 &lastChangeTicks;
    
public:
    ChatTextField(std::string &text, Player &player, Uint32 &lastChangeTicks, std::function<void()> onAccept = [](){});

    ChatTextField(std::string &&) = delete;

    virtual void onKeyDown(SDL_Keycode keycode) override;
};

#endif
