2023-08-31 16:11:47 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { Outlet } from 'react-router-dom';
|
|
|
|
import { NavItem } from '../components/NavItem';
|
|
|
|
import { UserOutlined } from '@ant-design/icons';
|
|
|
|
import { Button, Dropdown } from 'antd';
|
|
|
|
|
|
|
|
export const Layout: React.FC = React.memo(() => {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div className="flex items-center bg-gray-100 px-4">
|
|
|
|
<div className="px-2 mr-10 font-bold">Tianji</div>
|
2023-09-01 16:52:43 +00:00
|
|
|
<div className="flex gap-8">
|
2023-08-31 16:11:47 +00:00
|
|
|
<NavItem to="/dashboard" label="Dashboard" />
|
|
|
|
<NavItem to="/monitor" label="Monitor" />
|
|
|
|
<NavItem to="/website" label="Website" />
|
|
|
|
<NavItem to="/Servers" label="Servers" />
|
|
|
|
<NavItem to="/settings" label="Settings" />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="flex-1" />
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<Dropdown
|
|
|
|
placement="bottomRight"
|
|
|
|
menu={{
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
key: 'logout',
|
|
|
|
label: 'Logout',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}}
|
|
|
|
>
|
2023-09-01 16:52:43 +00:00
|
|
|
<Button shape="circle" size="large" icon={<UserOutlined />} />
|
2023-08-31 16:11:47 +00:00
|
|
|
</Dropdown>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-09-01 16:52:43 +00:00
|
|
|
<div className="max-w-7xl m-auto px-4">
|
2023-08-31 16:11:47 +00:00
|
|
|
<Outlet />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
});
|
|
|
|
Layout.displayName = 'Layout';
|