import React from 'react'; import { Box, Flex } from '@chakra-ui/react'; import Image from 'next/image'; import { useRouter } from 'next/router'; import Icon from '../Icon'; export enum NavbarTypeEnum { normal = 'normal', small = 'small' } const Navbar = ({ navbarList }: { navbarList: { label: string; icon: string; link: string; activeLink: string[]; }[]; }) => { const router = useRouter(); return ( {/* logo */} {/* 导航列表 */} {navbarList.map((item) => ( { if (item.link === router.pathname) return; router.push(item.link, undefined, { shallow: true }); }} cursor={'pointer'} fontSize={'sm'} w={'60px'} h={'70px'} borderRadius={'sm'} {...(item.activeLink.includes(router.pathname) ? { color: '#2B6CB0', backgroundColor: '#BEE3F8' } : { color: '#4A5568', backgroundColor: 'transparent' })} > {item.label} ))} {/* 通知 icon */} {/* */} ); }; export default Navbar;