54 lines
1.4 KiB
JavaScript
Raw Normal View History

2023-04-22 20:39:27 +08:00
import React from 'react';
import SystemSetting from '../../components/SystemSetting';
2023-11-21 16:35:51 +08:00
import {isRoot} from '../../helpers';
2023-04-22 20:39:27 +08:00
import OtherSetting from '../../components/OtherSetting';
import PersonalSetting from '../../components/PersonalSetting';
import OperationSetting from '../../components/OperationSetting';
2023-11-21 16:35:51 +08:00
import {Layout, TabPane, Tabs} from "@douyinfe/semi-ui";
2023-04-22 20:39:27 +08:00
const Setting = () => {
2023-11-21 16:35:51 +08:00
let panes = [
{
tab: '个人设置',
content: <PersonalSetting/>,
itemKey: '1'
}
];
2023-04-22 20:39:27 +08:00
2023-11-21 16:35:51 +08:00
if (isRoot()) {
panes.push({
tab: '运营设置',
content: <OperationSetting/>,
itemKey: '2'
});
panes.push({
tab: '系统设置',
content: <SystemSetting/>,
itemKey: '3'
});
panes.push({
tab: '其他设置',
content: <OtherSetting/>,
itemKey: '4'
});
}
2023-04-22 20:39:27 +08:00
2023-11-21 16:35:51 +08:00
return (
<div>
<Layout>
<Layout.Content>
<Tabs type="line" defaultActiveKey="1">
{panes.map(pane => (
<TabPane itemKey={pane.itemKey} tab={pane.tab}>
{pane.content}
</TabPane>
))}
</Tabs>
</Layout.Content>
</Layout>
</div>
);
2023-04-22 20:39:27 +08:00
};
export default Setting;