import { memo } from 'react'; import type { CSSProperties } from 'react'; import { Link } from 'react-router'; import NavigateNextIcon from '@mui/icons-material/NavigateNext'; import { Avatar, ListItem, ListItemAvatar, ListItemButton, ListItemIcon, ListItemText } from '@mui/material'; import type { SvgIconProps } from '@mui/material'; interface ListMenuItemProps { icon: React.ComponentType; bgcolor?: string; label: string; text: string; to?: string; disabled?: boolean; } // Extract styles to prevent recreation const iconStyles: CSSProperties = { justifyContent: 'right', color: 'lightblue', verticalAlign: 'middle' }; const RenderIcon = memo( ({ icon: Icon, bgcolor, label, text }: ListMenuItemProps) => ( <> ) ); const LayoutMenuItem = ({ icon, bgcolor, label, text, to, disabled }: ListMenuItemProps) => ( <> {to && !disabled ? ( } > ) : ( )} ); export default memo(LayoutMenuItem);