Files
frontend/app/components/popup/TextPreviewPopup.vue
T
2026-08-21 15:29:01 +02:00

27 lines
660 B
Vue

<template>
<div v-if="loading" class="h-40 animate-pulse rounded-md bg-surface-raised" />
<pre v-else class="whitespace-pre-wrap break-words font-mono text-xs text-text">{{ text }}</pre>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
const payload = usePopup().require<{ bucket: string; key: string }>().payload!
const { getObjectText } = useS3Client()
const loading = ref(true)
const text = ref('')
onMounted(async () => {
try {
text.value = await getObjectText(payload.bucket, payload.key)
}
catch {
text.value = 'Datei konnte nicht geladen werden.'
}
finally {
loading.value = false
}
})
</script>