|
1 | | -import React, { useState, useRef, useEffect, memo, useCallback, useMemo } from 'react'; |
| 1 | +import type React from 'react'; |
| 2 | +import { useState, useRef, useEffect, memo, useCallback, useMemo } from 'react'; |
2 | 3 | import { useNavigate } from 'react-router-dom'; |
3 | 4 | import { useZoom } from '@/lib/contexts/ZoomContext'; |
4 | 5 | import { useTabs } from '@/lib/contexts/TabsContext'; |
5 | 6 | import { useEditHistoryContext } from '@/lib/contexts/EditHistoryContext'; |
6 | 7 | import { getElectronAPI } from '@/lib/navigation'; |
7 | | -import FileReaderTopNavbar, { ZoomValue } from '@/components/reader/FileReaderTopNavbar'; |
| 8 | +import FileReaderTopNavbar, { type ZoomValue } from '@/components/reader/FileReaderTopNavbar'; |
8 | 9 | import NoteBar from '@/components/reader/NoteBar'; |
9 | 10 | import DocumentViewer, { DEFAULT_FILES, FileType } from '@/components/viewer/DocumentViewer'; |
10 | 11 | import { ScrollMode } from '@/components/viewer/PDFViewer'; |
@@ -66,7 +67,7 @@ const FileReaderContent = memo(() => { |
66 | 67 | }>({ totalMatches: 0, currentMatch: 0 }); |
67 | 68 |
|
68 | 69 | // Store the search function provided by PDFViewer |
69 | | - const searchFunctionRef = useRef<(text: string, direction: 'forward' | 'backward') => void | null>(null); |
| 70 | + const searchFunctionRef = useRef<(text: string, direction: 'forward' | 'backward') => undefined | null>(null); |
70 | 71 |
|
71 | 72 | // Handler for finding text (called from search modal) |
72 | 73 | const handleFindText = useCallback((text: string, direction: 'forward' | 'backward') => { |
@@ -199,7 +200,7 @@ const FileReaderContent = memo(() => { |
199 | 200 | }, [filePath, setIsLoading]); |
200 | 201 |
|
201 | 202 | // Handle page change |
202 | | - const handlePageChange = useCallback((newPage: number, manual: boolean = false) => { |
| 203 | + const handlePageChange = useCallback((newPage: number, manual = false) => { |
203 | 204 | if (newPage >= 1 && newPage <= (numPages || 1)) { |
204 | 205 | // Update our internal state |
205 | 206 | setPageNumber(newPage); |
|
0 commit comments