diff --git a/src/app/epub/[id]/page.tsx b/src/app/epub/[id]/page.tsx index 317528d..6778b4e 100644 --- a/src/app/epub/[id]/page.tsx +++ b/src/app/epub/[id]/page.tsx @@ -6,12 +6,16 @@ import { useCallback, useEffect, useState } from 'react'; import { useEPUB } from '@/contexts/EPUBContext'; import { DocumentSkeleton } from '@/components/DocumentSkeleton'; import { EPUBViewer } from '@/components/EPUBViewer'; +import { Button } from '@headlessui/react'; +import { DocumentSettings } from '@/components/DocumentSettings'; +import { SettingsIcon } from '@/components/icons/Icons'; export default function EPUBPage() { const { id } = useParams(); const { setCurrentDocument, currDocName, clearCurrDoc } = useEPUB(); const [error, setError] = useState(null); const [isLoading, setIsLoading] = useState(true); + const [isSettingsOpen, setIsSettingsOpen] = useState(false); const loadDocument = useCallback(async () => { if (!isLoading) return; @@ -66,6 +70,13 @@ export default function EPUBPage() { Documents +

{isLoading ? 'Loading...' : currDocName} @@ -79,6 +90,7 @@ export default function EPUBPage() { ) : ( )} + ); } \ No newline at end of file diff --git a/src/app/pdf/[id]/page.tsx b/src/app/pdf/[id]/page.tsx index 591a86c..bbf602e 100644 --- a/src/app/pdf/[id]/page.tsx +++ b/src/app/pdf/[id]/page.tsx @@ -8,7 +8,7 @@ import { useCallback, useEffect, useState } from 'react'; import { DocumentSkeleton } from '@/components/DocumentSkeleton'; import { useTTS } from '@/contexts/TTSContext'; import { Button } from '@headlessui/react'; -import { PDFViewSettings } from '@/components/PDFViewSettings'; +import { DocumentSettings } from '@/components/DocumentSettings'; import { SettingsIcon } from '@/components/icons/Icons'; // Dynamic import for client-side rendering only @@ -123,7 +123,7 @@ export default function PDFViewerPage() { ) : ( )} - + ); } diff --git a/src/components/DocumentList.tsx b/src/components/DocumentList.tsx index a6ed5f6..a81c5ea 100644 --- a/src/components/DocumentList.tsx +++ b/src/components/DocumentList.tsx @@ -3,6 +3,7 @@ import { Button, Dialog } from '@headlessui/react'; import { Transition, TransitionChild, DialogPanel, DialogTitle } from '@headlessui/react'; import { Fragment, useState } from 'react'; import { useDocuments } from '@/contexts/DocumentContext'; +import { PDFIcon, EPUBIcon } from '@/components/icons/Icons'; type DocumentToDelete = { id: string; @@ -82,13 +83,9 @@ export function DocumentList() { >
{doc.type === 'pdf' ? ( - - - + ) : ( - - - + )}
diff --git a/src/components/PDFViewSettings.tsx b/src/components/DocumentSettings.tsx similarity index 96% rename from src/components/PDFViewSettings.tsx rename to src/components/DocumentSettings.tsx index 8628c9e..dc15191 100644 --- a/src/components/PDFViewSettings.tsx +++ b/src/components/DocumentSettings.tsx @@ -5,9 +5,10 @@ import { Dialog, DialogPanel, DialogTitle, Transition, TransitionChild, Listbox, import { useConfig, ViewType } from '@/contexts/ConfigContext'; import { ChevronUpDownIcon, CheckIcon } from '@/components/icons/Icons'; -interface PDFViewSettingsProps { +interface DocViewSettingsProps { isOpen: boolean; setIsOpen: (isOpen: boolean) => void; + epub?: boolean; } const viewTypes = [ @@ -16,7 +17,7 @@ const viewTypes = [ { id: 'scroll', name: 'Continuous Scroll' }, ]; -export function PDFViewSettings({ isOpen, setIsOpen }: PDFViewSettingsProps) { +export function DocumentSettings({ isOpen, setIsOpen, epub }: DocViewSettingsProps) { const { viewType, skipBlank, updateConfigKey } = useConfig(); const selectedView = viewTypes.find(v => v.id === viewType) || viewTypes[0]; @@ -55,7 +56,7 @@ export function PDFViewSettings({ isOpen, setIsOpen }: PDFViewSettingsProps) {
-
+ {!epub &&
)} -
+
}