mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 15:09:22 +00:00
36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
import { useGlobal } from '@/lib/global'
|
||
import { siteConfig } from '@/lib/config'
|
||
import { MenuItemCollapse } from './MenuItemCollapse'
|
||
import CONFIG from '../config'
|
||
|
||
export const MenuListSide = (props) => {
|
||
const { customNav, customMenu } = props
|
||
const { locale } = useGlobal()
|
||
|
||
let links = [
|
||
{ icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: siteConfig('HEO_MENU_ARCHIVE', null, CONFIG) },
|
||
{ icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: siteConfig('HEO_MENU_SEARCH', null, CONFIG) },
|
||
{ icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: siteConfig('HEO_MENU_CATEGORY', null, CONFIG) },
|
||
{ icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: siteConfig('HEO_MENU_TAG', null, CONFIG) }
|
||
]
|
||
|
||
if (customNav) {
|
||
links = customNav.concat(links)
|
||
}
|
||
|
||
// 如果 开启自定义菜单,则覆盖Page生成的菜单
|
||
if (siteConfig('CUSTOM_MENU')) {
|
||
links = customMenu
|
||
}
|
||
|
||
if (!links || links.length === 0) {
|
||
return null
|
||
}
|
||
|
||
return (
|
||
<nav className='flex-col space-y-2'>
|
||
{links?.map((link, index) => <MenuItemCollapse key={index} link={link} />)}
|
||
</nav>
|
||
)
|
||
}
|