import { useState } from 'react'; import { Link, useNavigate } from 'react-router-dom'; import { Button } from '@/components/ui/button'; import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; import { useAuth } from '@/contexts/AuthContext'; import { User, Settings, LogOut, Code2, Shield, Crown } from 'lucide-react'; export function UserMenu() { const { user, logout } = useAuth(); const navigate = useNavigate(); const [isOpen, setIsOpen] = useState(false); const handleLogout = () => { logout(); navigate('/'); setIsOpen(false); }; const toggleMenu = () => { setIsOpen(!isOpen); }; const closeMenu = () => { setIsOpen(false); }; if (!user) return null; return (