♻️ Migrate the exploring page
This commit is contained in:
16
app/components/AttachmentItem.vue
Normal file
16
app/components/AttachmentItem.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<img v-if="itemType == 'image'" :src="remoteSource" class="rounded-md">
|
||||
<audio v-else-if="itemType == 'audio'" :src="remoteSource" controls />
|
||||
<video v-else-if="itemType == 'video'" :src="remoteSource" controls />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = defineProps<{ item: any }>()
|
||||
|
||||
const itemType = computed(() => props.item.mime_type.split('/')[0] ?? 'unknown')
|
||||
|
||||
const apiBase = useSolarNetworkUrl();
|
||||
const remoteSource = computed(() => `${apiBase}/drive/files/${props.item.id}?original=true`)
|
||||
</script>
|
Reference in New Issue
Block a user