dynamic-pdf-preview.tsx 403 B

123456789101112131415161718
  1. 'use client'
  2. import dynamic from 'next/dynamic'
  3. type DynamicPdfPreviewProps = {
  4. url: string
  5. onCancel: () => void
  6. }
  7. const DynamicPdfPreview = dynamic<DynamicPdfPreviewProps>(
  8. (() => {
  9. if (typeof window !== 'undefined')
  10. return import('./pdf-preview')
  11. }) as any,
  12. { ssr: false }, // This will prevent the module from being loaded on the server-side
  13. )
  14. export default DynamicPdfPreview