Download apps/readest-app/src/app/reader/components/sidebar/BooknotesNav.tsx from echodict/readest: direct link, hf CLI and curl.
- Browser
- Download file 1.59 kB
-
https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/app/reader/components/sidebar/BooknotesNav.tsx
- Command line
-
hf download hf://datasets/echodict/readest/apps/readest-app/src/app/reader/components/sidebar/BooknotesNav.tsx
-
curl -L -o BooknotesNav.tsx https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/app/reader/components/sidebar/BooknotesNav.tsx
1.59 kB
| import React from 'react'; | |
| import { Insets } from '@/types/misc'; | |
| import { TOCItem } from '@/libs/document'; | |
| import { useTranslation } from '@/hooks/useTranslation'; | |
| import { useBooknotesNav } from '../../hooks/useBooknotesNav'; | |
| import ContentNavBar from './ContentNavBar'; | |
| interface BooknotesNavProps { | |
| bookKey: string; | |
| gridInsets: Insets; | |
| toc: TOCItem[]; | |
| } | |
| const BooknotesNav: React.FC<BooknotesNavProps> = ({ bookKey, gridInsets, toc }) => { | |
| const { | |
| activeBooknoteType, | |
| currentSection, | |
| showBooknotesNav, | |
| hasPreviousPage, | |
| hasNextPage, | |
| handleShowResults, | |
| handleClose, | |
| handlePrevious, | |
| handleNext, | |
| } = useBooknotesNav(bookKey, toc); | |
| const _ = useTranslation(); | |
| if (!showBooknotesNav) { | |
| return null; | |
| } | |
| const getShowResultsTitle = () => { | |
| switch (activeBooknoteType) { | |
| case 'bookmark': | |
| return _('Bookmarks'); | |
| case 'annotation': | |
| return _('Annotations'); | |
| case 'excerpt': | |
| return _('Excerpts'); | |
| default: | |
| return ''; | |
| } | |
| }; | |
| return ( | |
| <ContentNavBar | |
| bookKey={bookKey} | |
| gridInsets={gridInsets} | |
| title={getShowResultsTitle()} | |
| section={currentSection} | |
| hasPrevious={hasPreviousPage} | |
| hasNext={hasNextPage} | |
| progress={1} | |
| previousTitle={_('Previous')} | |
| nextTitle={_('Next')} | |
| showResultsTitle={getShowResultsTitle()} | |
| closeTitle={_('Close')} | |
| onShowResults={handleShowResults} | |
| onClose={handleClose} | |
| onPrevious={handlePrevious} | |
| onNext={handleNext} | |
| /> | |
| ); | |
| }; | |
| export default BooknotesNav; | |