2023-01-11 16:18:56 +01:00
|
|
|
import { FC, useState } from "react";
|
2022-12-02 10:55:56 +00:00
|
|
|
import { Grid } from "@mui/material";
|
|
|
|
|
import { Sidebar } from "./Sidebar";
|
|
|
|
|
|
2023-01-11 16:18:56 +01:00
|
|
|
export const Layout = ({ children }) => {
|
|
|
|
|
const [open, setOpen] = useState(true);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Grid container direction="row">
|
|
|
|
|
<Sidebar open={open} setOpen={setOpen} />
|
|
|
|
|
<Grid
|
|
|
|
|
item
|
|
|
|
|
sx={{ ml: open ? "270px" : "100px", width: "100%", height: "100vh" }}
|
|
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</Grid>
|
2022-12-02 10:55:56 +00:00
|
|
|
</Grid>
|
2023-01-11 16:18:56 +01:00
|
|
|
);
|
|
|
|
|
};
|