aboutsummaryrefslogtreecommitdiff
path: root/src/components/report/report.js
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2022-08-09 21:56:15 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2022-08-09 21:56:15 +0000
commit750696643ffde27c1e8ae5a50253bbee5bfc4249 (patch)
tree0d6cf88d2ae191f79b604057d5a06b322b77d2aa /src/components/report/report.js
parent7773e7de6454a7ecd79b695ba27cccabeaca184e (diff)
parent572f28d7c9efea4300cb88063baf4daab91e7910 (diff)
Merge branch 'feat/report-notification' into 'develop'
#949 Feat/report notification See merge request pleroma/pleroma-fe!1322
Diffstat (limited to 'src/components/report/report.js')
-rw-r--r--src/components/report/report.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/components/report/report.js b/src/components/report/report.js
new file mode 100644
index 00000000..76055764
--- /dev/null
+++ b/src/components/report/report.js
@@ -0,0 +1,34 @@
+import Select from '../select/select.vue'
+import StatusContent from '../status_content/status_content.vue'
+import Timeago from '../timeago/timeago.vue'
+import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
+
+const Report = {
+ props: [
+ 'reportId'
+ ],
+ components: {
+ Select,
+ StatusContent,
+ Timeago
+ },
+ computed: {
+ report () {
+ return this.$store.state.reports.reports[this.reportId] || {}
+ },
+ state: {
+ get: function () { return this.report.state },
+ set: function (val) { this.setReportState(val) }
+ }
+ },
+ methods: {
+ generateUserProfileLink (user) {
+ return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames)
+ },
+ setReportState (state) {
+ return this.$store.dispatch('setReportState', { id: this.report.id, state })
+ }
+ }
+}
+
+export default Report