Add base authenticated route

This commit is contained in:
2025-11-04 21:31:54 +01:00
parent d9c96e85f7
commit fdcd565431
13 changed files with 952 additions and 4 deletions

View File

@@ -0,0 +1,46 @@
import * as React from "react";
import ListSubheader from "@mui/material/ListSubheader";
import type {} from "@mui/material/themeCssVarsAugmentation";
import DashboardSidebarContext from "./DashboardSidebarContext";
import { DRAWER_WIDTH } from "./constants";
import { getDrawerSxTransitionMixin } from "./mixins";
export interface DashboardSidebarHeaderItemProps {
children?: React.ReactNode;
}
export default function DashboardSidebarHeaderItem({
children,
}: DashboardSidebarHeaderItemProps) {
const sidebarContext = React.useContext(DashboardSidebarContext);
if (!sidebarContext) {
throw new Error("Sidebar context was used without a provider.");
}
const {
mini = false,
fullyExpanded = true,
hasDrawerTransitions,
} = sidebarContext;
return (
<ListSubheader
sx={{
fontSize: 12,
fontWeight: "600",
height: mini ? 0 : 36,
...(hasDrawerTransitions
? getDrawerSxTransitionMixin(fullyExpanded, "height")
: {}),
px: 1.5,
py: 0,
minWidth: DRAWER_WIDTH,
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
zIndex: 2,
}}
>
{children}
</ListSubheader>
);
}