#pragma once

#include "GuiWidget.h"

#include "updater/Updater.h"

#include <future>

namespace td {
namespace gui {

class UpdateMenu : public GuiWidget {
private:
    bool m_Opened;
    std::string m_Error;
    utils::Updater m_Updater;
    std::shared_future<bool> m_UpdateAvailable;
public:
    UpdateMenu(client::Client* client);

    virtual void Render();
private:
    void CheckUpdates();
    bool IsUpdateChecked();
    void RenderErrorPopup();
};

} // namespace gui
} // namespace td
