diff --git a/src/components/HTMLViewer.tsx b/src/components/HTMLViewer.tsx index 7d96236..e1d00c9 100644 --- a/src/components/HTMLViewer.tsx +++ b/src/components/HTMLViewer.tsx @@ -5,6 +5,7 @@ import ReactMarkdown from 'react-markdown'; import remarkGfm from 'remark-gfm'; import { useHTML } from '@/contexts/HTMLContext'; import { DocumentSkeleton } from '@/components/DocumentSkeleton'; +import { TableOfContents } from '@/components/TableOfContents'; interface HTMLViewerProps { className?: string; @@ -19,6 +20,7 @@ export function HTMLViewer({ className = '' }: HTMLViewerProps) { totalChapters, goToNextChapter, goToPreviousChapter, + goToChapter, } = useHTML(); const containerRef = useRef(null); @@ -48,13 +50,20 @@ export function HTMLViewer({ className = '' }: HTMLViewerProps) { Previous -
- - {currentChapter?.title || `Chapter ${currentChapterIndex + 1}`} - - - ({currentChapterIndex + 1} of {totalChapters}) - +
+
+ + {currentChapter?.title || `Chapter ${currentChapterIndex + 1}`} + + + ({currentChapterIndex + 1} of {totalChapters}) + +
+
+ + {/* Table of Contents Modal */} + + setIsOpen(false)} + > + +
+ + +
+
+ + + + Table of Contents + + + {/* Chapters List */} +
+
+ {chapters.map((chapter, index) => ( + + ))} +
+
+ + {/* Close Button */} +
+ +
+
+
+
+
+
+
+ + ); +}