#pragma once // Spec: INV-posts 11.3. The report sheet: cancel, confirm, reasons form, details field, failure state. #include #include "screens/components/ReportViewModel.hpp" #include "ui/Navigation.hpp" namespace dp { class ReportScreen : public ui::Screen { public: explicit ReportScreen(std::shared_ptr model); ~ReportScreen() override; ui::ViewPtr body() override; std::string title() const override { return model_->sheetTitle(); } TitleMode titleMode() const override { return TitleMode::Inline; } ui::ViewPtr toolbarLeading() override; ui::ViewPtr toolbarTrailing() override; void onAppear() override; bool busy() const override { return model_->isSubmitting(); } // Tap on "Report": submit, close the sheet and show the thank-you alert on success. void confirm(); // Shows the "Thank you" alert for the noun. static void showThankYou(const std::string& noun); private: ui::ViewPtr reasonsForm(); ui::ViewPtr failedState(); ui::ViewPtr reasonRow(const ReportReason& reason); std::shared_ptr model_; std::shared_ptr alive_ = std::make_shared(true); }; } // namespace dp