/* * 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 { List, ListItem, ListItemText, Switch } from '@mui/material'; import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction'; import Select from '@mui/material/Select'; import MenuItem from '@mui/material/MenuItem'; import { useTranslation } from 'react-i18next'; import { IReaderSettings } from '@/typings'; interface IProps extends IReaderSettings { setSettingValue: (key: keyof IReaderSettings, value: string | boolean) => void; } export default function ReaderSettingsOptions({ staticNav, loadNextOnEnding, readerType, showPageNumber, skipDupChapters, setSettingValue, fitPageToWindow, }: IProps) { const { t } = useTranslation(); const fitPageToWindowEligible = [ 'ContinuesVertical', 'Webtoon', 'SingleVertical', 'SingleRTL', 'SingleLTR', ].includes(readerType); return ( setSettingValue('staticNav', e.target.checked)} /> setSettingValue('showPageNumber', e.target.checked)} /> setSettingValue('loadNextOnEnding', e.target.checked)} /> setSettingValue('skipDupChapters', e.target.checked)} /> {fitPageToWindowEligible ? ( setSettingValue('fitPageToWindow', e.target.checked)} /> ) : null} ); }