link-stack/apps/link/app/(main)/_components/InternalLayout.tsx

33 lines
833 B
TypeScript
Raw Normal View History

2023-06-26 10:07:12 +00:00
"use client";
import { FC, PropsWithChildren, useState } from "react";
import { Grid, Box } from "@mui/material";
2022-12-02 10:55:56 +00:00
import { Sidebar } from "./Sidebar";
import { SetupModeWarning } from "./SetupModeWarning";
2022-12-02 10:55:56 +00: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 (
<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>
</Box>
2023-01-11 16:18:56 +01:00
);
};