import React from 'react'; import ListItemButton from '@mui/material/ListItemButton'; import ListItemText from '@mui/material/ListItemText'; import ListItemIcon from '@mui/material/ListItemIcon'; import Icon from '@mui/material/Icon'; import Tooltip from '@mui/material/Tooltip'; interface GlobalMenuElementProps { drawerOpen?: boolean; icon: string; label: string; shortLabel?: string; to?: string; selected?: boolean; history: any; onClick?: (to: string | undefined) => void; disabled?: boolean; } const KOSMenuElement = (props: GlobalMenuElementProps): React.ReactElement => { const { drawerOpen, icon, label, to, shortLabel, selected, history, onClick, disabled, } = props; const onClickHandler = () => { if (onClick) { onClick(to); } else if (to) { if (to.includes('http')) { window.location.href = to; } else { history?.push(to); } } }; return ( {icon} ); }; KOSMenuElement.defaultProps = { to: undefined, onClick: undefined, shortLabel: undefined, selected: undefined, history: undefined, disabled: undefined, }; export default KOSMenuElement;