2022-03-20 01:31:36 -07:00
|
|
|
import Select from '../select/select.vue'
|
2021-01-11 09:32:58 -08:00
|
|
|
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: [
|
2021-01-18 05:26:08 -08:00
|
|
|
'reportId'
|
2021-01-11 09:32:58 -08:00
|
|
|
],
|
|
|
|
components: {
|
2022-03-20 01:31:36 -07:00
|
|
|
Select,
|
2021-01-11 09:32:58 -08:00
|
|
|
StatusContent,
|
|
|
|
Timeago
|
|
|
|
},
|
2021-01-18 05:26:08 -08:00
|
|
|
computed: {
|
|
|
|
report () {
|
|
|
|
return this.$store.state.reports.reports[this.reportId] || {}
|
2021-01-27 03:13:10 -08:00
|
|
|
},
|
|
|
|
state: {
|
|
|
|
get: function () { return this.report.state },
|
|
|
|
set: function (val) { this.setReportState(val) }
|
2021-01-18 05:26:08 -08:00
|
|
|
}
|
|
|
|
},
|
2021-01-11 09:32:58 -08:00
|
|
|
methods: {
|
|
|
|
generateUserProfileLink (user) {
|
|
|
|
return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames)
|
|
|
|
},
|
2021-01-27 03:13:10 -08:00
|
|
|
setReportState (state) {
|
|
|
|
return this.$store.dispatch('setReportState', { id: this.report.id, state })
|
2021-01-11 09:32:58 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Report
|