#pragma once

#include <string>

#include <ftxui/screen/color.hpp>

namespace torlinkc::ui {

// Ported from ui/theme.ts. FTXUI Colors instead of hex strings, but the same
// palette.
namespace palette {
inline const ftxui::Color accent = ftxui::Color::RGB(167, 139, 250);
inline const ftxui::Color text = ftxui::Color::RGB(233, 228, 245);
inline const ftxui::Color alt = ftxui::Color::RGB(185, 167, 230);
inline const ftxui::Color good = ftxui::Color::RGB(134, 214, 162);
inline const ftxui::Color warn = ftxui::Color::RGB(240, 197, 96);
inline const ftxui::Color bad = ftxui::Color::RGB(238, 125, 146);
inline const ftxui::Color bright = ftxui::Color::RGB(216, 180, 254);
inline const ftxui::Color rule = ftxui::Color::RGB(107, 101, 119);
inline const ftxui::Color paused = ftxui::Color::RGB(124, 119, 133);
}  // namespace palette

namespace icon {
inline constexpr const char* done = "✓";
inline constexpr const char* error = "✗";
inline constexpr const char* pending = "·";
inline constexpr const char* pointer = "❯";
inline constexpr const char* dot = "·";
inline constexpr const char* warn = "⚠";
inline constexpr const char* bar = "▌";
inline constexpr const char* down = "↓";
inline constexpr const char* up = "↑";
inline constexpr const char* peer = "•";
inline constexpr const char* pause = "⏸";
}  // namespace icon

struct SourceStyle {
  std::string tag;
  ftxui::Color color;
};

// Tolerant lookup: falls back to a neutral tag rather than crashing on an
// absent/unknown source id (a pasted magnet, or a removed source persisted
// in old history).
SourceStyle sourceStyle(const std::string& id);

}  // namespace torlinkc::ui
