summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notes/components/note_attachment.vue
blob: 34ecbd00c63a88b3f480968f4eb5011e2f5e5037 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<script>
export default {
  name: 'NoteAttachment',
  props: {
    attachment: {
      type: Object,
      required: true,
    },
  },
};
</script>

<template>
  <div class="note-attachment">
    <a
      v-if="attachment.image"
      :href="attachment.url"
      target="_blank"
      rel="noopener noreferrer">
      <img
        :src="attachment.url"
        class="note-image-attach"
      />
    </a>
    <div class="attachment">
      <a
        v-if="attachment.url"
        :href="attachment.url"
        target="_blank"
        rel="noopener noreferrer">
        <i
          class="fa fa-paperclip"
          aria-hidden="true">
        </i>
        {{ attachment.filename }}
      </a>
    </div>
  </div>
</template>