'use client' import { noop } from 'es-toolkit/function' import * as React from 'react' import { useState } from 'react' import { useHotkeys } from 'react-hotkeys-hook' import { PdfHighlighter, PdfLoader } from 'react-pdf-highlighter' import Loading from '@/app/components/base/loading' import 'react-pdf-highlighter/dist/style.css' type PdfFilePreviewProps = { downloadUrl: string } const PdfFilePreview = ({ downloadUrl }: PdfFilePreviewProps) => { const [scale, setScale] = useState(1) const zoomIn = () => { setScale(prevScale => Math.min(prevScale * 1.2, 3)) } const zoomOut = () => { setScale(prevScale => Math.max(prevScale / 1.2, 0.5)) } useHotkeys('up', zoomIn) useHotkeys('down', zoomOut) return (