/* * 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 { ArrowDownward, ArrowUpward } from '@mui/icons-material'; import { Drawer, FormControlLabel, Radio, RadioGroup, Tab, Tabs, } from '@mui/material'; import { Box } from '@mui/system'; import TabPanel from 'components/util/TabPanel'; import ThreeStateCheckbox from 'components/util/ThreeStateCheckbox'; import React, { useCallback, useState } from 'react'; import { SORT_OPTIONS } from './util'; interface IProps{ open: boolean onClose: () => void; options: ChapterListOptions optionsDispatch: React.Dispatch } const TabContent: React.FC<{ children: React.ReactNode }> = ({ children }) => ( {children} ); const ChapterOptions: React.FC = ({ open, onClose, options, optionsDispatch, }) => { const [tabNum, setTabNum] = useState(0); const handleFilterChange = useCallback( (value: NullAndUndefined, name: string) => { optionsDispatch({ type: 'filter', filterType: name.toLowerCase(), filterValue: value }); }, [], ); return ( <> setTabNum(newTab)} indicatorColor="primary" textColor="primary" > } label="Unread" /> } label="Downloaded" /> } label="Bookmarked" /> { SORT_OPTIONS.map(([mode, label]) => ( : } onClick={() => (mode !== options.sortBy ? optionsDispatch({ type: 'sortBy', sortBy: mode }) : optionsDispatch({ type: 'sortReverse' }))} /> )} label={label} /> )) } optionsDispatch({ type: 'showChapterNumber' })} value={options.showChapterNumber}> } /> } /> ); }; export default ChapterOptions;