pleroma-fe/src/components/report/report.js

38 lines
1.1 KiB
JavaScript
Raw Normal View History

import Select from '../select/select.vue'
2021-01-11 18:32:58 +01:00
import StatusContent from '../status_content/status_content.vue'
import Timeago from '../timeago/timeago.vue'
2023-10-27 01:44:22 +02:00
import RichContent from 'src/components/rich_content/rich_content.jsx'
2021-01-11 18:32:58 +01:00
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
const Report = {
props: [
2021-01-18 14:26:08 +01:00
'reportId'
2021-01-11 18:32:58 +01:00
],
components: {
Select,
2021-01-11 18:32:58 +01:00
StatusContent,
2023-10-27 01:44:22 +02:00
Timeago,
RichContent
2021-01-11 18:32:58 +01:00
},
2021-01-18 14:26:08 +01:00
computed: {
report () {
2023-10-27 01:44:22 +02:00
console.log(this.$store.state.reports.reports[this.reportId] || {})
2021-01-18 14:26:08 +01:00
return this.$store.state.reports.reports[this.reportId] || {}
2021-01-27 12:13:10 +01:00
},
state: {
get: function () { return this.report.state },
set: function (val) { this.setReportState(val) }
2021-01-18 14:26:08 +01:00
}
},
2021-01-11 18:32:58 +01:00
methods: {
generateUserProfileLink (user) {
return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames)
},
2021-01-27 12:13:10 +01:00
setReportState (state) {
return this.$store.dispatch('setReportState', { id: this.report.id, state })
2021-01-11 18:32:58 +01:00
}
}
}
export default Report