import { useState, useEffect } from 'react' import { Outlet, Link, useNavigate, useLocation } from 'react-router-dom' import { useAuthStore } from '@/store/auth' import { Gamepad2, LogOut, Trophy, User, Menu, X } from 'lucide-react' import { TelegramLink } from '@/components/TelegramLink' import { clsx } from 'clsx' export function Layout() { const { user, isAuthenticated, logout } = useAuthStore() const navigate = useNavigate() const location = useLocation() const [isScrolled, setIsScrolled] = useState(false) const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false) useEffect(() => { const handleScroll = () => { setIsScrolled(window.scrollY > 10) } window.addEventListener('scroll', handleScroll) return () => window.removeEventListener('scroll', handleScroll) }, []) // Close mobile menu on route change useEffect(() => { setIsMobileMenuOpen(false) }, [location]) const handleLogout = () => { logout() navigate('/login') } const isActiveLink = (path: string) => location.pathname === path return (