-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
913ddc3
commit f45644c
Showing
7 changed files
with
1,115 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
'use client'; | ||
import React, { useState } from 'react'; | ||
import { | ||
DesktopOutlined, | ||
FileOutlined, | ||
PieChartOutlined, | ||
TeamOutlined, | ||
UserOutlined, | ||
} from '@ant-design/icons'; | ||
import type { MenuProps } from 'antd'; | ||
import { Breadcrumb, Layout, Menu, theme } from 'antd'; | ||
|
||
const { Header, Content, Footer, Sider } = Layout; | ||
|
||
type MenuItem = Required<MenuProps>['items'][number]; | ||
|
||
function getItem( | ||
label: React.ReactNode, | ||
key: React.Key, | ||
icon?: React.ReactNode, | ||
children?: MenuItem[] | ||
): MenuItem { | ||
return { | ||
key, | ||
icon, | ||
children, | ||
label, | ||
} as MenuItem; | ||
} | ||
|
||
const items: MenuItem[] = [ | ||
getItem('Option 1', '1', <PieChartOutlined />), | ||
getItem('Option 2', '2', <DesktopOutlined />), | ||
getItem('User', 'sub1', <UserOutlined />, [ | ||
getItem('Tom', '3'), | ||
getItem('Bill', '4'), | ||
getItem('Alex', '5'), | ||
]), | ||
getItem('Team', 'sub2', <TeamOutlined />, [ | ||
getItem('Team 1', '6'), | ||
getItem('Team 2', '8'), | ||
]), | ||
getItem('Files', '9', <FileOutlined />), | ||
]; | ||
|
||
const Dashboard: React.FC = () => { | ||
const [collapsed, setCollapsed] = useState(false); | ||
const { | ||
token: { colorBgContainer, borderRadiusLG }, | ||
} = theme.useToken(); | ||
|
||
return ( | ||
<Layout style={{ minHeight: '100vh' }}> | ||
<Sider | ||
collapsible | ||
collapsed={collapsed} | ||
onCollapse={(value) => setCollapsed(value)} | ||
> | ||
<div className="demo-logo-vertical" /> | ||
<Menu | ||
theme="dark" | ||
defaultSelectedKeys={['1']} | ||
mode="inline" | ||
items={items} | ||
/> | ||
</Sider> | ||
<Layout> | ||
<Header style={{ padding: 0, background: colorBgContainer }} /> | ||
<Content style={{ margin: '0 16px' }}> | ||
<Breadcrumb style={{ margin: '16px 0' }}> | ||
<Breadcrumb.Item>User</Breadcrumb.Item> | ||
<Breadcrumb.Item>Bill</Breadcrumb.Item> | ||
</Breadcrumb> | ||
<div | ||
style={{ | ||
padding: 24, | ||
minHeight: 360, | ||
background: colorBgContainer, | ||
borderRadius: borderRadiusLG, | ||
}} | ||
> | ||
Bill is a cat. | ||
</div> | ||
</Content> | ||
<Footer style={{ textAlign: 'center' }}></Footer> | ||
</Layout> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default Dashboard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.