<script setup lang="ts">
import FilePreview from '@af-mobile-client-vue3/components/data/FilePreview/index.vue'
import { onMounted, ref } from 'vue'

const previewDocType = ref('pdf')
const previewDocUrl = ref('/resource/af-revenue/pdf/e0a35f3414444d009cbce020af2e617d.pdf')

const filePreviewRef = ref<InstanceType<typeof FilePreview> | null>(null)

onMounted(() => {
  filePreviewRef.value?.init({
    path: '/resource/af-revenue/pdf/e0a35f3414444d009cbce020af2e617d.pdf',
  })
})
</script>

<template>
  <div>
    <FilePreview
      ref="filePreviewRef"
      :key="`${previewDocType}-${previewDocUrl}`"
      class="doc-preview-file"
    />
  </div>
</template>

<style scoped lang="less">
.doc-preview-file {
  height: 90vh;
}
</style>
