mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
updates to backend to match new frontend - #1665
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import NavigateNextIcon from '@mui/icons-material/NavigateNext';
|
||||
import { Avatar, ListItem, ListItemAvatar, ListItemButton, ListItemIcon, ListItemText } from '@mui/material';
|
||||
import { Fragment, type FC } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import type { SvgIconProps } from '@mui/material';
|
||||
import type { FC } from 'react';
|
||||
|
||||
interface ListMenuItemProps {
|
||||
icon: React.ComponentType<SvgIconProps>;
|
||||
bgcolor?: string;
|
||||
label: string;
|
||||
text: string;
|
||||
to: string;
|
||||
to?: string;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
@@ -27,12 +27,8 @@ function RenderIcon({ icon: Icon, bgcolor, label, text }: ListMenuItemProps) {
|
||||
}
|
||||
|
||||
const LayoutMenuItem: FC<ListMenuItemProps> = ({ icon, bgcolor, label, text, to, disabled }) => (
|
||||
<Fragment>
|
||||
{disabled ? (
|
||||
<ListItem>
|
||||
<RenderIcon icon={icon} bgcolor={bgcolor} label={label} text={text} to="" />
|
||||
</ListItem>
|
||||
) : (
|
||||
<>
|
||||
{to && !disabled ? (
|
||||
<ListItem
|
||||
disablePadding
|
||||
secondaryAction={
|
||||
@@ -45,8 +41,12 @@ const LayoutMenuItem: FC<ListMenuItemProps> = ({ icon, bgcolor, label, text, to,
|
||||
<RenderIcon icon={icon} bgcolor={bgcolor} label={label} text={text} to="" />
|
||||
</ListItemButton>
|
||||
</ListItem>
|
||||
) : (
|
||||
<ListItem>
|
||||
<RenderIcon icon={icon} bgcolor={bgcolor} label={label} text={text} to="" />
|
||||
</ListItem>
|
||||
)}
|
||||
</Fragment>
|
||||
</>
|
||||
);
|
||||
|
||||
export default LayoutMenuItem;
|
||||
|
||||
Reference in New Issue
Block a user