#include "screens/post/PostContentView.hpp" #include "screens/components/Box.hpp" #include "screens/post/PressProxyView.hpp" #include "ui/Markdown.hpp" namespace dp { using namespace ui; ViewPtr PostContentView(const std::optional& topic, const std::optional& title, const std::string& content, const PostEnvironment& env) { std::vector parts; if (topic) parts.push_back(CapsuleLabel(*topic)); if (title) { parts.push_back(TappableSelectableText(MarkdownView(*title, FontSpec::title().size)->maxWidth(Alignment::leading()), *title, env)); } parts.push_back(TappableSelectableText(MarkdownView(content)->maxWidth(Alignment::leading()), content, env)); return VStack(parts, 8, HAlign::Leading)->maxWidth(Alignment::leading()); } } // namespace dp