#pragma once #include #include "katja/repository.hpp" namespace katja { class UpdatesPage : public ftxui::ComponentBase { std::vector updatable; public: explicit UpdatesPage(std::vector&& updatable) : updatable(std::move(updatable)) { } ftxui::Element Render() override { std::vector> lines; for (const auto& package_identifier : this->updatable) { auto line = ftxui::text(package_identifier.to_string()) | color(ftxui::Color::SkyBlue2); lines.push_back(line); } ftxui::Element summary = ftxui::text(" Updates (" + std::to_string(lines.size()) + ")"); return ftxui::window(summary, ftxui::vbox(lines)); } }; }