<script setup lang="ts">
import { VPdfViewer } from '@vue-pdf-viewer/viewer'
import pdfWorker from 'pdfjs-dist/build/pdf.worker?url'

defineProps<{
  src: string
}>()
</script>

<template>
  <ClientOnly>
    <VPdfViewer :src="src" :workerUrl="pdfWorker" class="h-[80vh] w-full" />
    <template #fallback>
      <div class="flex items-center justify-center h-[80vh]">
        <p>Loading PDF...</p>
      </div>
    </template>
  </ClientOnly>
</template>
