mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-13 19:29:55 +03:00
formatting
This commit is contained in:
@@ -2,7 +2,14 @@ import type { FC } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import NavigateNextIcon from '@mui/icons-material/NavigateNext';
|
||||
import { Avatar, ListItem, ListItemAvatar, ListItemButton, ListItemIcon, ListItemText } from '@mui/material';
|
||||
import {
|
||||
Avatar,
|
||||
ListItem,
|
||||
ListItemAvatar,
|
||||
ListItemButton,
|
||||
ListItemIcon,
|
||||
ListItemText
|
||||
} from '@mui/material';
|
||||
import type { SvgIconProps } from '@mui/material';
|
||||
|
||||
interface ListMenuItemProps {
|
||||
@@ -27,19 +34,38 @@ function RenderIcon({ icon: Icon, bgcolor, label, text }: ListMenuItemProps) {
|
||||
);
|
||||
}
|
||||
|
||||
const LayoutMenuItem: FC<ListMenuItemProps> = ({ icon, bgcolor, label, text, to, disabled }) => (
|
||||
const LayoutMenuItem: FC<ListMenuItemProps> = ({
|
||||
icon,
|
||||
bgcolor,
|
||||
label,
|
||||
text,
|
||||
to,
|
||||
disabled
|
||||
}) => (
|
||||
<>
|
||||
{to && !disabled ? (
|
||||
<ListItem
|
||||
disablePadding
|
||||
secondaryAction={
|
||||
<ListItemIcon style={{ justifyContent: 'right', color: 'lightblue', verticalAlign: 'middle' }}>
|
||||
<ListItemIcon
|
||||
style={{
|
||||
justifyContent: 'right',
|
||||
color: 'lightblue',
|
||||
verticalAlign: 'middle'
|
||||
}}
|
||||
>
|
||||
<NavigateNextIcon />
|
||||
</ListItemIcon>
|
||||
}
|
||||
>
|
||||
<ListItemButton component={Link} to={to}>
|
||||
<RenderIcon icon={icon} bgcolor={bgcolor} label={label} text={text} to="" />
|
||||
<RenderIcon
|
||||
icon={icon}
|
||||
bgcolor={bgcolor}
|
||||
label={label}
|
||||
text={text}
|
||||
to=""
|
||||
/>
|
||||
</ListItemButton>
|
||||
</ListItem>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user