import BLOG from '@/blog.config' import { useGlobal } from '@/lib/global' import { useState } from 'react' import CONFIG_SIMPLE from '../config_simple' import { DropMenu } from './DropMenu' /** * 菜单导航 * @param {*} props * @returns */ export const Nav = ({ customNav, customMenu }) => { const { locale } = useGlobal() const [showSearchInput, changeShowSearchInput] = useState(false) const toggleShowSearchInput = () => { changeShowSearchInput(!showSearchInput) } let links = [ { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_SIMPLE.MENU_SEARCH }, { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_SIMPLE.MENU_ARCHIVE }, { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_SIMPLE.MENU_CATEGORY }, { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_SIMPLE.MENU_TAG } ] if (customNav) { links = links.concat(customNav) } if (BLOG.CUSTOM_MENU) { links = customMenu } if (!links || links.length === 0) { return null } return ( ) }