#ifndef MACHINE_CONFIG_PANEL_HPP_
#define MACHINE_CONFIG_PANEL_HPP_

#include <Controller/Controller.hpp>
#include <Utilities/RGBABytes.hpp>
#include <Widget/Layout/CompoundWidget/CompoundWidget.hpp>
#include <Widget/TabList/TabList.hpp>

/**
 * @brief A panel for saving/loading machine config.
 */
class MachineConfigPanel : public CompoundWidget
{
private:
    struct State
    {
        RGBABytes chipColor;

        State();
    };

    Player *player;
    Controller &ctrl;

public:
    MachineConfigPanel(
        Player *player,
        std::string machineBlockName,
        std::string stateUrl,
        Material &machineIcon,
        Controller &ctrl
    );

    template<typename... TArgs>
    static TabList::Page* page(TArgs&&... args)
    {
        return new TabList::Page(
            Material::memoryChip,
            "Save/load config",
            new MachineConfigPanel(args...)
        );
    }
};

#endif