aboutsummaryrefslogtreecommitdiff
path: root/src/components/attachment/attachment.js
blob: fa43c12ff4d6db4caefb239b5d5ab5ec939e5289 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import nsfwImage from '../../assets/nsfw.jpg'
import fileTypeService from '../../services/file_type/file_type.service.js'

const Attachment = {
  props: [
    'attachment',
    'nsfw',
    'statusId'
  ],
  data: () => ({ nsfwImage }),
  computed: {
    type () {
      return fileTypeService.fileType(this.attachment.mimetype)
    }
  },
  methods: {
    showNsfw () {
      this.$store.commit('setNsfw', { id: this.statusId, nsfw: false })
    }
  }
}

export default Attachment