origin/apps/web/src/components/layout/main/top-nav-bar.tsx

48 lines
1.7 KiB
TypeScript
Raw Normal View History

2024-12-31 15:57:32 +08:00
2025-02-06 16:32:52 +08:00
import { UserMenu } from '../element/usermenu/usermenu';
2024-12-31 15:57:32 +08:00
import { NotificationsDropdown } from './notifications-dropdown';
import { SearchBar } from './search-bar';
import { UserMenuDropdown } from './usermenu-dropdown';
import { Bars3Icon } from '@heroicons/react/24/outline';
interface TopNavBarProps {
sidebarOpen: boolean;
setSidebarOpen: (open: boolean) => void;
notifications: number;
notificationItems: Array<any>;
recentSearches: string[];
}
export function TopNavBar({
sidebarOpen,
setSidebarOpen,
notifications,
notificationItems,
recentSearches
}: TopNavBarProps) {
return (
<nav className="fixed top-0 left-0 right-0 h-16 bg-white shadow-sm z-50">
<div className="flex items-center justify-between h-full px-4">
<div className="flex items-center gap-4">
<button
onClick={() => setSidebarOpen(!sidebarOpen)}
2025-01-03 09:24:46 +08:00
className="p-2 rounded-lg hover:bg-gray-100 transition-colors">
<Bars3Icon className='w-5 h-5' />
2024-12-31 15:57:32 +08:00
</button>
2025-01-03 09:24:46 +08:00
<h1 className="text-xl font-semibold text-slate-800 tracking-wide">
2025-01-03 09:24:55 +08:00
fhmooc
2024-12-31 15:57:32 +08:00
</h1>
</div>
<SearchBar recentSearches={recentSearches} />
<div className="flex items-center gap-4">
<NotificationsDropdown
notifications={notifications}
notificationItems={notificationItems}
/>
2025-02-06 16:32:52 +08:00
<UserMenu />
2024-12-31 15:57:32 +08:00
</div>
</div>
</nav>
);
}