46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
import RichContent from 'src/components/rich_content/rich_content.jsx'
|
|
import Select from '../select/select.vue'
|
|
import StatusContent from '../status_content/status_content.vue'
|
|
import Timeago from '../timeago/timeago.vue'
|
|
|
|
import { useInstanceStore } from 'src/stores/instance.js'
|
|
import { useReportsStore } from 'src/stores/reports.js'
|
|
|
|
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
|
|
|
const Report = {
|
|
props: ['reportId'],
|
|
components: {
|
|
Select,
|
|
StatusContent,
|
|
Timeago,
|
|
RichContent,
|
|
},
|
|
computed: {
|
|
report() {
|
|
return useReportsStore().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,
|
|
useInstanceStore().restrictedNicknames,
|
|
)
|
|
},
|
|
setReportState(state) {
|
|
return useReportsStore().setReportState({ id: this.report.id, state })
|
|
},
|
|
},
|
|
}
|
|
|
|
export default Report
|