/* * 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, Tab, Tabs } from '@mui/material'; import TabPanel from 'components/util/TabPanel'; import React, { useState } from 'react'; import OptionsPanel from 'components/molecules/OptionsPanel'; interface IProps { open: boolean; onClose: () => void; tabs: T[]; tabTitle: (key: T) => React.ReactNode; tabContent: (key: T) => React.ReactNode; minHeight?: number; } const OptionsTabs = ({ open, onClose, tabs, tabTitle, tabContent, minHeight, }: IProps) => { const [tabNum, setTabNum] = useState(0); return ( setTabNum(newTab)} indicatorColor="primary" textColor="primary" > {tabs.map((tab, tabIndex) => ( ))} {tabs.map((tab, tabIndex) => ( {tabContent(tab)} ))} ); }; OptionsTabs.defaultProps = { minHeight: undefined, }; export default OptionsTabs;