diff options
| author | Eugen Wissner <belka@caraus.de> | 2025-04-01 23:36:50 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2025-04-01 23:36:50 +0200 |
| commit | ff3c508ceb185d631aea7fed93329525d77a1704 (patch) | |
| tree | e67a52c78776e5c0f28c73d7797bcc2302f40dac /cli/component.cpp | |
| parent | 86ea47342b4a87c25c3daac1fe87d784990d65d6 (diff) | |
| download | kazbek-ff3c508ceb185d631aea7fed93329525d77a1704.tar.gz | |
Extract pages into components
Diffstat (limited to 'cli/component.cpp')
| -rw-r--r-- | cli/component.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/cli/component.cpp b/cli/component.cpp index e69de29..9e0593e 100644 --- a/cli/component.cpp +++ b/cli/component.cpp @@ -0,0 +1,28 @@ +#include "component.hpp" + +namespace katja +{ + ftxui::Element WelcomePage::Render() + { + return ftxui::text("Select an action in the menu."); + } + + UpdatesPage::UpdatesPage(std::vector<package_identifier>&& updatable) + : updatable(std::move(updatable)) + { + } + + ftxui::Element UpdatesPage::Render() + { + std::vector<std::shared_ptr<ftxui::Node>> 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)); + } +} |
