import React, { useState } from 'react'; import SystemSetting from '../../components/SystemSetting'; import { isRoot } from '../../helpers'; import OtherSetting from '../../components/OtherSetting'; import PersonalSetting from '../../components/PersonalSetting'; import OperationSetting from '../../components/OperationSetting'; import { Layout, TabPane, Tabs } from '@douyinfe/semi-ui'; const Setting = () => { const [tabActiveKey, setTabActiveKey] = useState('1'); let panes = [ { tab: '个人设置', content: , itemKey: '1', }, ]; if (isRoot()) { panes.push({ tab: '运营设置', content: , itemKey: '2', }); panes.push({ tab: '系统设置', content: , itemKey: '3', }); panes.push({ tab: '其他设置', content: , itemKey: '4', }); } return (
setTabActiveKey(key)} > {panes.map((pane) => ( {tabActiveKey === pane.itemKey && pane.content} ))}
); }; export default Setting;