import React, { useState } from 'react';
import {
AppBar,
Box,
CssBaseline,
Drawer,
IconButton,
List,
ListItem,
ListItemButton,
ListItemIcon,
ListItemText,
Toolbar,
Typography,
useTheme as useMuiTheme,
useMediaQuery,
Avatar,
Chip,
Divider,
Badge,
Tooltip,
} from '@mui/material';
import {
Menu as MenuIcon,
Dashboard as DashboardIcon,
Settings as SettingsIcon,
Build as BuildIcon,
History as HistoryIcon,
AccountCircle as AccountCircleIcon,
Notifications as NotificationsIcon,
BusinessCenter as BusinessCenterIcon,
Chat as ChatIcon,
AutoAwesome as AutoAwesomeIcon,
Compare as CompareIcon
} from '@mui/icons-material';
import { Routes, Route, useNavigate, useLocation } from 'react-router-dom';
import MainPage from '../pages/MainPage';
import ConfigurationPage from '../pages/ConfigurationPageNew';
import HistoryPage from '../pages/HistoryPage';
import SettingsPage from '../pages/SettingsPage';
import ChatPage from '../pages/ChatPage';
import DIYGeneratorPage from '../pages/DIYGeneratorPage';
import AnomalyPage from '../pages/AnomalyPage';
const drawerWidth = 240;
interface NavItem {
text: string;
icon: React.ReactElement;
path: string;
}
const navigationItems: NavItem[] = [
{ text: 'Dashboard', icon: , path: '/' },
{ text: 'DIY Generator', icon: , path: '/diy-generator' },
{ text: 'Configuration', icon: , path: '/configuration' },
{ text: 'Anomaly', icon: , path: '/anomaly' },
{ text: 'Chat', icon: , path: '/chat' },
// { text: 'History', icon: , path: '/history' },
{ text: 'Settings', icon: , path: '/settings' },
];
const Layout: React.FC = () => {
const theme = useMuiTheme();
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
const [mobileOpen, setMobileOpen] = useState(false);
const navigate = useNavigate();
const location = useLocation();
// Add keyframes for pulse animation
React.useEffect(() => {
const style = document.createElement('style');
style.textContent = `
@keyframes pulse {
0% {
transform: scale(0.95);
box-shadow: 0 0 0 0 rgba(77, 196, 212, 0.7);
}
70% {
transform: scale(1);
box-shadow: 0 0 0 6px rgba(77, 196, 212, 0);
}
100% {
transform: scale(0.95);
box-shadow: 0 0 0 0 rgba(77, 196, 212, 0);
}
}
`;
document.head.appendChild(style);
return () => {
document.head.removeChild(style);
};
}, []);
const handleDrawerToggle = () => {
setMobileOpen(!mobileOpen);
};
const handleNavigate = (path: string) => {
navigate(path);
if (isMobile) {
setMobileOpen(false);
}
};
const drawer = (
{/* Header Section */}
{/* Carelon Logo */}
Benefit Agent Portal
Behavioral Health Platform
{/* User Info Section */}
Benefit Agent
{/* Navigation Items */}
{navigationItems.map((item, index) => (
handleNavigate(item.path)}
sx={{
borderRadius: '12px',
py: 1.5,
px: 2,
'&.Mui-selected': {
backgroundColor: 'rgba(255, 255, 255, 0.15)',
backdropFilter: 'blur(10px)',
border: '1px solid rgba(255, 255, 255, 0.2)',
'&:hover': {
backgroundColor: 'rgba(255, 255, 255, 0.2)',
},
},
'&:hover': {
backgroundColor: 'rgba(255, 255, 255, 0.1)',
},
transition: 'all 0.3s ease',
}}
>
{item.icon}
{location.pathname === item.path && (
)}
))}
{/* Bottom Status */}
System Online
);
return (
{navigationItems.find(item => item.path === location.pathname)?.text || 'Dashboard'}
{location.pathname === '/' && 'Use Benefit AI Agent to perform Domain functions'}
{location.pathname === '/diy-generator' && 'Create custom benefit plans step by step'}
{location.pathname === '/configuration' && 'Configure processing parameters'}
{location.pathname === '/chat' && 'AI-powered health insurance benefits assistant'}
{location.pathname === '/history' && 'View processing history and reports'}
{location.pathname === '/settings' && 'Manage application settings'}
{/* Right side of AppBar */}
JD
}
label="Benefit Agent"
variant="outlined"
sx={{
backgroundColor: 'rgba(0, 0, 0, 0.02)',
border: '1px solid rgba(0, 0, 0, 0.08)',
'&:hover': {
backgroundColor: 'rgba(0, 0, 0, 0.04)',
}
}}
/>
{drawer}
{drawer}
} />
} />
} />
} />
} />
} />
} />
} />
);
};
export default Layout;