feat: add tooltips to sidebar icons

This commit is contained in:
CyberL1 2025-01-16 17:23:18 +01:00
parent 17c2a3042f
commit f1b7e063bb

View File

@ -16,6 +16,7 @@ import {
ListItemText, ListItemText,
ThemeProvider, ThemeProvider,
Toolbar, Toolbar,
Tooltip,
Typography, Typography,
} from "@mui/material"; } from "@mui/material";
import * as Icons from "@mui/icons-material"; import * as Icons from "@mui/icons-material";
@ -86,20 +87,22 @@ function App({ error }: { error?: boolean }) {
<Toolbar /> <Toolbar />
<List> <List>
{sidebarItems.map((item) => ( {sidebarItems.map((item) => (
<ListItem <Tooltip title={item.title} placement="left" arrow>
key={item.title} <ListItem
component={Link} key={item.title}
to={item.href} component={Link}
target={item.openInNewTab ? "_blank" : "_self"} to={item.href}
disablePadding target={item.openInNewTab ? "_blank" : "_self"}
> disablePadding
<ListItemButton> >
<ListItemIcon> <ListItemButton>
<Icon component={Icons[item.icon]} /> <ListItemIcon>
</ListItemIcon> <Icon component={Icons[item.icon]} />
<ListItemText primary={item.title} /> </ListItemIcon>
</ListItemButton> <ListItemText primary={item.title} />
</ListItem> </ListItemButton>
</ListItem>
</Tooltip>
))} ))}
</List> </List>
</Drawer> </Drawer>