#ifndef ITEM_PICKER_HPP_
#define ITEM_PICKER_HPP_

#include <ItemStack/ItemStack.hpp>
#include <Widget/Layout/CompoundWidget/CompoundWidget.hpp>
#include <ItemFilter/ItemFilterByName/ItemFilterByName.hpp>
#include <functional>

/**
 * @brief An item picker widget, allows you to search for items/blocks and pick one.
 */
class ItemPicker : public CompoundWidget
{
public:
    typedef std::function<void(ItemStack)> SelectionCallback;

private:
    static constexpr int compSpacing = 2;
    static constexpr int scrollPanelHeight = 70;
    static constexpr int numCols = 6;

    std::string query;
    std::vector<ItemStack> allStacks;
    ItemFilterByName filter;

public:
    ItemPicker(SelectionCallback onSelected);
};

#endif