/* * 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 Tab from '@mui/material/Tab'; import Tabs from '@mui/material/Tabs'; import React, { useState } from 'react'; import { TabPanel } from '@/modules/core/components/tabs/TabPanel.tsx'; import { OptionsPanel } from '@/modules/core/components/OptionsPanel.tsx'; interface IProps { open: boolean; onClose: () => void; tabs: T[]; tabTitle: (key: T) => React.ReactNode; tabContent: (key: T) => React.ReactNode; minHeight?: number; } export 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)} ))} ); };