import { Search, ChevronDown, LogOut } from 'lucide-react'; import { NotificationPopover } from '@/components/notifications/NotificationPopover'; import { cn } from '@/lib/utils'; import { useAuth } from '@/contexts/AuthContext'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; interface TopBarProps { title: string; description?: string; } export function TopBar({ title, description }: TopBarProps) { const { user, logout } = useAuth(); const getInitials = () => { if (user?.first_name && user?.last_name) { return `${user.first_name[0]}${user.last_name[0]}`.toUpperCase(); } return user?.username?.substring(0, 2).toUpperCase() || 'AD'; }; const getDisplayName = () => { if (user?.first_name && user?.last_name) { return `${user.first_name} ${user.last_name}`; } return user?.username || 'Admin User'; }; return (
{/* Page Title */}

{title}

{description && (

{description}

)}
{/* Right Section */}
{/* Search */}
{/* Notifications */} {/* Profile Dropdown */} My Account logout()} className="text-error cursor-pointer"> Log out
); }