20 lines
744 B
Vue
20 lines
744 B
Vue
<script setup lang="ts">
|
|
const props = defineProps<{
|
|
file: {
|
|
id: string;
|
|
name: string;
|
|
mimeType: string;
|
|
status?: 'pending' | 'uploaded';
|
|
url: string;
|
|
}
|
|
}>();
|
|
</script>
|
|
|
|
<template>
|
|
<img v-if="props.file.mimeType.startsWith('image/')" :src="props.file.url"
|
|
class="rounded-lg h-full w-full max-h-36 max-w-64 object-cover" />
|
|
<video v-else-if="props.file.mimeType.startsWith('video/')" controls :src="props.file.url"
|
|
class="rounded-lg h-full w-full max-h-36 max-w-64 aspect-ratio-video object-cover" />
|
|
<audio v-else-if="props.file.mimeType.startsWith('audio/')" :src="props.file.url"
|
|
class="rounded-lg h-full w-full max-h-36 max-w-64 object-cover" />
|
|
</template> |