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

42 lines
756 B
JavaScript
Raw Normal View History

2023-03-10 12:10:39 -05:00
import PostStatusForm from 'src/components/post_status_form/post_status_form.vue'
const Draft = {
components: {
PostStatusForm
},
props: {
draft: {
type: Object,
required: true
}
},
data () {
return {
editing: false
}
},
computed: {
relAttrs () {
if (this.draft.type === 'edit') {
return { statusId: this.draft.refId }
} else if (this.draft.type === 'reply') {
return { replyTo: this.draft.refId }
} else {
return {}
}
},
postStatusFormProps () {
return {
draftId: this.draft.id,
...this.relAttrs
}
}
},
methods: {
toggleEditing () {
this.editing = !this.editing
}
}
}
export default Draft