gitlab-org--gitlab-foss/app/assets/javascripts/notes/components/note_attachment.vue

42 lines
787 B
Vue
Raw Normal View History

<script>
import { GlIcon } from '@gitlab/ui';
2018-03-16 16:16:21 -04:00
export default {
name: 'NoteAttachment',
components: {
GlIcon,
},
2018-03-16 16:16:21 -04:00
props: {
attachment: {
type: Object,
required: true,
},
2018-03-16 16:16:21 -04:00
},
};
</script>
<template>
<div class="note-attachment">
<a
v-if="attachment.image"
ref="attachmentImage"
:href="attachment.url"
target="_blank"
rel="noopener noreferrer"
>
2018-11-16 15:07:38 -05:00
<img :src="attachment.url" class="note-image-attach" />
</a>
<div class="attachment">
<a
v-if="attachment.url"
ref="attachmentUrl"
:href="attachment.url"
target="_blank"
rel="noopener noreferrer"
>
<gl-icon name="paperclip" /> {{ attachment.filename }}
</a>
</div>
</div>
</template>