2023-06-26 10:07:12 +00:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import { FC, PropsWithChildren, useState } from "react";
|
2024-08-05 23:31:15 +02:00
|
|
|
import { Grid, Box } from "@mui/material";
|
2022-12-02 10:55:56 +00:00
|
|
|
import { Sidebar } from "./Sidebar";
|
2024-08-05 23:31:15 +02:00
|
|
|
import { SetupModeWarning } from "./SetupModeWarning";
|
2022-12-02 10:55:56 +00:00
|
|
|
|
2024-08-05 23:31:15 +02:00
|
|
|
interface InternalLayoutProps extends PropsWithChildren {
|
|
|
|
|
setupModeActive: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const InternalLayout: FC<InternalLayoutProps> = ({
|
|
|
|
|
children,
|
|
|
|
|
setupModeActive,
|
|
|
|
|
}) => {
|
2023-01-11 16:18:56 +01:00
|
|
|
const [open, setOpen] = useState(true);
|
|
|
|
|
|
|
|
|
|
return (
|
2024-08-05 23:31:15 +02:00
|
|
|
<Box sx={{ position: "relative" }}>
|
|
|
|
|
<SetupModeWarning setupModeActive={setupModeActive} />
|
|
|
|
|
<Grid container direction="row">
|
|
|
|
|
<Sidebar open={open} setOpen={setOpen} />
|
|
|
|
|
<Grid
|
|
|
|
|
item
|
|
|
|
|
sx={{ ml: open ? "270px" : "70px", width: "100%", height: "100vh" }}
|
|
|
|
|
>
|
|
|
|
|
{children as any}
|
|
|
|
|
</Grid>
|
2023-01-11 16:18:56 +01:00
|
|
|
</Grid>
|
2024-08-05 23:31:15 +02:00
|
|
|
</Box>
|
2023-01-11 16:18:56 +01:00
|
|
|
);
|
|
|
|
|
};
|