import { Button, Flex, Menu, MenuButton, MenuItem, MenuList, Portal, Tab, TabList, TabPanel, TabPanels, Tabs, Text, useBreakpointValue, } from '@chakra-ui/react'; import { PanelQMCv2Key } from './panels/PanelQMCv2Key'; import { useState } from 'react'; import { MdExpandMore, MdMenu } from 'react-icons/md'; const TABS: { name: string; Tab: () => JSX.Element }[] = [ { name: 'QMCv2 密钥', Tab: PanelQMCv2Key }, { name: '其它/待定', Tab: () => ( 这里空空如也~ ), }, ]; export function Settings() { const isLargeWidthDevice = useBreakpointValue({ base: false, lg: true, }) ?? false; const [tabIndex, setTabIndex] = useState(0); const handleTabChange = (idx: number) => { setTabIndex(idx); }; return ( } rightIcon={} colorScheme="gray" variant="outline" w="full" flexShrink={0} hidden={isLargeWidthDevice} mb="4" > {TABS[tabIndex].name} {TABS.map(({ name }, i) => ( setTabIndex(i)}> {name} ))} {TABS.map(({ name, Tab }) => ( ))} ); }