1
0
mirror of https://github.com/elk-zone/elk synced 2024-12-01 08:18:07 +09:00
elk/components/publish/PublishAttachment.vue
2022-11-25 22:31:37 +08:00

31 lines
620 B
Vue

<script setup lang="ts">
import type { Attachment } from 'masto'
withDefaults(defineProps<{
attachment: Attachment
alt?: string
removable?: boolean
}>(), {
removable: true,
})
defineEmits<{
(evt: 'remove'): void
}>()
</script>
<template>
<div relative group>
<StatusAttachment :attachment="attachment" w-full />
<div absolute right-2 top-2>
<div
v-if="removable"
hover:bg="gray/40" transition-100 p-1 rounded-5 cursor-pointer op-0 group-hover:op-100
@click="$emit('remove')"
>
<div i-ri:close-line text-3 />
</div>
</div>
</div>
</template>