updates to backend to match new frontend - #1665

This commit is contained in:
proddy
2024-03-22 16:25:18 +01:00
parent c8e7eb3657
commit a2fa2515b3
23 changed files with 360 additions and 293 deletions

View File

@@ -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;