Skip to content
Repos

DevPlaceApp

C++ 987 B32 lines Opens in site

Directory Raw Download

#pragma once
// Spec: INV-posts 3.4. HStack(spacing 12){ VoteView, ReactionsBar, Spacer, HStack(spacing 24){ reply, report,
// edit, delete } }. Edit and delete exist only when their callbacks are given (own posts).
#include <cstdint>
#include <functional>
#include <string>

#include "model/Reactions.hpp"
#include "model/Vote.hpp"
#include "ui/Views.hpp"

namespace dp {

struct PostFooterProps {
  std::string targetId;
  std::string authorId;
  std::int64_t starCount = 0;
  Vote currentVote;
  Reactions reactions;
  std::function<void(const std::string&)> onReact;
  std::function<void()> onReply;  // empty = no reply button
  bool isReplying = false;
  std::function<void()> onEdit;
  std::function<void()> onDelete;
};

ui::ViewPtr PostFooterView(const PostFooterProps& props);

// Presents the "Delete this ...?" confirmation with Delete (destructive) and Cancel.
void presentDeleteConfirmation(const std::string& question, std::function<void()> onDelete);

}  // namespace dp
44.5ms