import { useNavigate, useLocation } from "react-router-dom"; import { FaHome, FaServer, FaPalette, FaUser } from "react-icons/fa"; import { useAuthStore } from "@/modules/auth/store/useAuthStore"; export const Navigation = () => { const navigate = useNavigate(); const location = useLocation(); const { user, logout } = useAuthStore(); const navItems = [ { path: "/", label: "Главная", icon: FaHome }, { path: "/add-agents", label: "Агенты", icon: FaServer }, { path: "/themes", label: "Темы", icon: FaPalette }, ]; const isActive = (path: string) => location.pathname === path; return (
{/* Логотип */}
navigate("/")} > HellreigN
{/* Навигация */}
{navItems.map((item) => { const Icon = item.icon; const active = isActive(item.path); return ( ); })}
{/* Профиль пользователя */}
{user && (
{user.name}
)}
); };