import React from 'react'; import { Layout, theme } from 'antd'; import { Outlet, useNavigate, useLocation } from 'react-router-dom'; import { ScanOutlined, FileTextOutlined, SettingOutlined } from '@ant-design/icons'; const { Content } = Layout; export const AppLayout: React.FC = () => { const navigate = useNavigate(); const location = useLocation(); const { token: { colorBgContainer, colorPrimary, colorTextSecondary }, } = theme.useToken(); const path = location.pathname; let activeKey = 'invoices'; if (path.startsWith('/ocr')) activeKey = 'ocr'; else if (path.startsWith('/settings')) activeKey = 'settings'; const menuItems = [ { key: 'invoices', icon: , label: 'Накладные', path: '/invoices' }, { key: 'ocr', icon: , label: 'Обучение', path: '/ocr' }, { key: 'settings', icon: , label: 'Настройки', path: '#' }, ]; return ( {/* Верхнюю шапку (Header) удалили для экономии места */} {/* Убрали лишние паддинги вокруг контента для мобилок */}
{/* Нижний Таб-бар */}
{menuItems.map(item => { const isActive = activeKey === item.key; return (
navigate(item.path)} style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', width: '33%', cursor: 'pointer', color: isActive ? colorPrimary : colorTextSecondary }} > {item.icon} {item.label}
); })}
); };