'use client';
import { Menu } from "lucide-react";
import { Sprout } from 'lucide-react';
import { MessageBell } from './components/MessageBell';
import { UserProfile } from './components/UserProfile';
import { ThemeToggle } from './ThemeToggle';
import { usePathname, useRouter } from 'next/navigation';
import { Button } from "@/components/ui/button";
import {
NavigationMenu,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
} from "@/components/ui/navigation-menu";
import {
Sheet,
SheetContent,
SheetHeader,
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet";
interface MenuItem {
title: string;
url: string;
description?: string;
icon?: React.ReactNode;
items?: MenuItem[];
}
interface Navbar1Props {
navbarData: {
logo: {
url: string;
src: string;
alt: string;
title: string;
};
menu: MenuItem[];
auth: {
login: {
title: string;
url: string;
};
signup: {
title: string;
url: string;
};
};
};
}
const Navbar1 = ({ navbarData }: Navbar1Props) => {
const logo = navbarData.logo
const menu = navbarData.menu
const auth = navbarData.auth
const pathname = usePathname()
const router = useRouter()
const containerStyle = {
maxWidth:"100%",marginLeft:"0px",marginRight:"0px",paddingLeft:"1rem",paddingRight:"0rem"
}
// 检查当前路径是否匹配菜单项
const isMenuActive = (url: string) => {
// 精确匹配
if (pathname === url) return true;
// 检查是否是该菜单下的子路径
if (pathname.startsWith(url + '/')) return true;
return false;
}
const handleMessageClick = () => {
// 处理消息点击事件,可以跳转到消息中心页面
console.log('Navigate to message center');
};
const handleProfileClick = () => {
// 处理个人中心点击事件
console.log('Navigate to profile page');
};
return (
// {item.description} //
// )} //