import { HomeOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons'; import { Divider, Layout, Tooltip } from 'antd'; import { type ReactNode, memo, useState } from 'react'; import { NavLink } from 'react-router-dom'; import styles from './styles.module.css'; type NavItem = { link: string; label: string; icon: ReactNode; }; type Group = { title: string; key: string; children: NavItem[]; }; // Каркас: разделы меню — по карте экранов docs/context/10-user-journey.md, добавляются срезами. const config: Group[] = [ { title: 'Главная', key: 'home', children: [{ link: '/', icon: , label: 'Главная' }], }, ]; function CollapsedIcon({ icon, title, to }: { icon: ReactNode; title: string; to: string }) { return ( `${styles.iconBtn} ${isActive ? styles.iconBtnActive : styles.iconBtnNav}`}> {icon} ); } function NavLinkStyled({ to, children }: { to: string; children: ReactNode }) { return ( `${styles.linkBase} ${isActive ? styles.linkActive : ''}`} to={to}> {children} ); } const Section = memo(function Section({ isCollapsed, group }: { isCollapsed: boolean; group: Group }) { return !isCollapsed ? (
{group.title}
{group.children.map((i) => ( {i.icon} {i.label} ))}
) : ( <> {group.children.map((i) => ( ))} ); }); export function Sidebar() { const [isCollapsed, setIsCollapsed] = useState(false); return (
{config.map((g) => (
))}
); }