import { useState } from 'react'; import { Routes, Route, useNavigate, useLocation } from 'react-router-dom'; import { Layout, Menu, Button, Avatar, Dropdown, Typography } from 'antd'; import { DashboardOutlined, MessageOutlined, WhatsAppOutlined, SettingOutlined, LogoutOutlined, UserOutlined, MenuFoldOutlined, MenuUnfoldOutlined, } from '@ant-design/icons'; import { useAuthStore } from '../store/auth'; import Dashboard from '../pages/Dashboard'; import WhatsAppAccounts from '../pages/WhatsAppAccounts'; import Inbox from '../pages/Inbox'; const { Header, Sider, Content } = Layout; const { Text } = Typography; export default function MainLayout() { const [collapsed, setCollapsed] = useState(false); const navigate = useNavigate(); const location = useLocation(); const { user, logout } = useAuthStore(); const handleLogout = () => { logout(); navigate('/login'); }; const menuItems = [ { key: '/', icon: , label: 'Dashboard', }, { key: '/inbox', icon: , label: 'Inbox', }, { key: '/whatsapp', icon: , label: 'WhatsApp', }, { key: '/settings', icon: , label: 'Configuración', }, ]; const userMenu = [ { key: 'profile', icon: , label: 'Mi perfil', }, { type: 'divider' as const, }, { key: 'logout', icon: , label: 'Cerrar sesión', onClick: handleLogout, }, ]; return ( {!collapsed && ( WA Central )} navigate(key)} style={{ border: 'none' }} /> : } onClick={() => setCollapsed(!collapsed)} /> {user?.name?.charAt(0).toUpperCase()} {user?.name} } /> } /> } /> Configuración (próximamente)} /> ); }