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

22 lines
531 B
TypeScript
Raw Normal View History

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