29 lines
736 B
C++
29 lines
736 B
C++
#pragma once
|
|
|
|
#include <optional>
|
|
|
|
#include <ftxui/component/event.hpp>
|
|
#include <ftxui/component/component.hpp>
|
|
#include <ftxui/dom/elements.hpp>
|
|
|
|
#include "katja/repository.hpp"
|
|
|
|
namespace katja
|
|
{
|
|
class PackageListBase : public ftxui::ComponentBase
|
|
{
|
|
std::string title;
|
|
const std::vector<package_identifier> packages;
|
|
std::optional<std::size_t> selected;
|
|
|
|
public:
|
|
PackageListBase(const std::string& title, const std::vector<package_identifier>& packages = {});
|
|
|
|
ftxui::Element OnRender() override;
|
|
bool OnEvent(ftxui::Event event) override;
|
|
};
|
|
|
|
ftxui::Component PackageList(const std::string& title, const std::vector<package_identifier>& packages = {});
|
|
|
|
}
|