/* * Copyright (C) Contributors to the Suwayomi project * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import Stack from '@mui/material/Stack'; import { useTranslation } from 'react-i18next'; import MenuItem from '@mui/material/MenuItem'; import { useMemo } from 'react'; import FormControl from '@mui/material/FormControl'; import InputLabel from '@mui/material/InputLabel'; import { Select } from '@/modules/core/components/inputs/Select.tsx'; import { getPage } from '@/modules/reader/utils/ReaderProgressBar.utils.tsx'; import { ReaderStatePages } from '@/modules/reader/types/ReaderProgressBar.types.ts'; import { ReaderControls } from '@/modules/reader/services/ReaderControls.ts'; import { useGetOptionForDirection } from '@/modules/theme/services/ThemeCreator.ts'; import { ReaderService } from '@/modules/reader/services/ReaderService.ts'; import { ReaderNavBarDesktopNextPreviousButton } from '@/modules/reader/components/overlay/navigation/desktop/ReaderNavBarDesktopNextPreviousButton.tsx'; import { READING_DIRECTION_TO_THEME_DIRECTION } from '@/modules/reader/constants/ReaderSettings.constants.tsx'; export const ReaderNavBarDesktopPageNavigation = ({ currentPageIndex, pages, }: Pick) => { const { t } = useTranslation(); const openPage = ReaderControls.useOpenPage(); const { readingDirection } = ReaderService.useSettings(); const getOptionForDirection = useGetOptionForDirection(); const currentPage = useMemo(() => getPage(currentPageIndex, pages), [currentPageIndex, pages]); const direction = READING_DIRECTION_TO_THEME_DIRECTION[readingDirection.value]; return ( openPage('previous')} /> {t('reader.page_info.label.page')} openPage('next')} /> ); };