link-stack/apps/link/app/(main)/_components/InternalLayout.tsx
2025-11-10 14:55:22 +01:00

35 lines
861 B
TypeScript

"use client";
import { FC, PropsWithChildren, useState } from "react";
import { Grid, Box } from "@mui/material";
import { Sidebar } from "./Sidebar";
import { SetupModeWarning } from "./SetupModeWarning";
interface InternalLayoutProps extends PropsWithChildren {
setupModeActive: boolean;
}
export const InternalLayout: FC<InternalLayoutProps> = ({
children,
setupModeActive,
}) => {
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>
</Grid>
</Box>
);
};