Simplify dashboard code

This commit is contained in:
2025-11-04 22:02:56 +01:00
parent 79b5a767f3
commit 3de26c0fff
4 changed files with 20 additions and 51 deletions

View File

@@ -12,7 +12,6 @@ import DashboardSidebarContext from "./DashboardSidebarContext";
import { MINI_DRAWER_WIDTH } from "./constants";
export interface DashboardSidebarPageItemProps {
id: string;
title: string;
icon?: React.ReactNode;
href: string;
@@ -21,7 +20,6 @@ export interface DashboardSidebarPageItemProps {
}
export default function DashboardSidebarPageItem({
id,
title,
icon,
href,
@@ -40,12 +38,6 @@ export default function DashboardSidebarPageItem({
fullyExpanded = true,
} = sidebarContext;
const handleClick = React.useCallback(() => {
if (onPageItemClick) {
onPageItemClick();
}
}, [onPageItemClick, id]);
const hasExternalHref = href
? href.startsWith("http://") || href.startsWith("https://")
: false;
@@ -56,7 +48,7 @@ export default function DashboardSidebarPageItem({
return (
<React.Fragment>
<ListItem disablePadding>
<ListItem disablePadding style={{ padding: "5px" }}>
<ListItemButton
selected={selected}
disabled={disabled}
@@ -72,7 +64,7 @@ export default function DashboardSidebarPageItem({
}
: {}),
to: href,
onClick: handleClick,
onClick: onPageItemClick,
}}
>
{icon || mini ? (