Files
ThriveX-Admin/src/pages/Setup/index.tsx

84 lines
2.7 KiB
TypeScript
Raw Normal View History

2024-08-08 15:27:57 +08:00
import { useState } from 'react';
import { Card } from 'antd';
import Title from '@/components/Title';
2024-08-08 16:00:46 +08:00
import { BiGlobe, BiLayout, BiShieldQuarter, BiUser } from 'react-icons/bi';
import System from './components/System'
2024-08-08 16:08:12 +08:00
import Web from './components/Web'
2024-08-08 16:49:28 +08:00
import Layout from './components/Layout'
2024-08-08 16:56:37 +08:00
import My from './components/My'
2024-08-08 15:27:57 +08:00
import "./index.scss"
interface Setup {
title: string;
description: string;
icon: React.ReactNode;
key: string;
}
const SetupPage = () => {
const [active, setActive] = useState("system");
2024-08-08 16:00:46 +08:00
const iconSty = "w-5 h-8 mr-1"
2024-08-08 15:27:57 +08:00
const list: Setup[] = [
{
title: "系统配置",
description: "配置管理员账号、登录时间等",
2024-08-08 16:00:46 +08:00
icon: <BiShieldQuarter className={iconSty} />,
2024-08-08 15:27:57 +08:00
key: "system"
},
{
title: "网站配置",
description: "配置网站标题、LOGO、描述、SEO等",
2024-08-08 16:00:46 +08:00
icon: <BiGlobe className={iconSty} />,
2024-08-08 15:27:57 +08:00
key: "web"
},
{
title: "布局配置",
description: "配置网站布局及代码高亮等",
2024-08-08 16:00:46 +08:00
icon: <BiLayout className={iconSty} />,
2024-08-08 15:27:57 +08:00
key: "layout"
},
{
title: "个人设置",
description: "配置个人信息等",
2024-08-08 16:00:46 +08:00
icon: <BiUser className={iconSty} />,
2024-08-08 15:27:57 +08:00
key: "my"
}
];
return (
<>
<Title value="项目配置" />
<Card className='SetupPage mt-2'>
<div className="flex">
2024-08-20 12:56:21 +08:00
<ul className="w[20%] mr-5 border-r border-[#eee] divide-y divide-solid divide-[#F6F6F6]">
2024-08-08 15:27:57 +08:00
{list.map((item) => (
<li
key={item.key}
2024-08-20 12:56:21 +08:00
className={`item p-3 pl-5 cursor-pointer transition-colors ${active === item.key ? 'active' : ''}`}
2024-08-08 16:00:46 +08:00
onClick={() => setActive(item.key)}
2024-08-08 15:27:57 +08:00
>
<h3 className="flex items-center text-base">
2024-08-08 16:00:46 +08:00
{item.icon} {item.title}
2024-08-08 15:27:57 +08:00
</h3>
<p className="text-[13px] text-[#858585] text-gray-500 mt-1">{item.description}</p>
</li>
))}
</ul>
2024-08-08 18:47:49 +08:00
<div className='w-[80%] px-8'>
2024-08-08 16:00:46 +08:00
{active === "system" && <System />}
2024-08-08 16:08:12 +08:00
{active === "web" && <Web />}
2024-08-08 16:49:28 +08:00
{active === "layout" && <Layout />}
2024-08-08 16:56:37 +08:00
{active === "my" && <My />}
2024-08-08 15:27:57 +08:00
</div>
</div>
</Card>
</>
);
};
export default SetupPage;