2023-12-31 02:53:25 +00:00
|
|
|
import {
|
|
|
|
Breakpoint,
|
|
|
|
Container,
|
|
|
|
SxProps,
|
|
|
|
Theme,
|
|
|
|
useMediaQuery,
|
|
|
|
useTheme,
|
|
|
|
} from "@mui/material";
|
2022-12-09 11:48:15 +00:00
|
|
|
import React, { ElementType } from "react";
|
|
|
|
|
|
|
|
interface Props {
|
2023-12-31 02:53:25 +00:00
|
|
|
component?: ElementType;
|
|
|
|
outerContainerSx?: SxProps<Theme>;
|
|
|
|
sx?: SxProps<Theme>;
|
|
|
|
maxWidth?: false | Breakpoint;
|
|
|
|
children?: React.ReactNode;
|
2022-12-09 11:48:15 +00:00
|
|
|
}
|
|
|
|
|
2023-12-31 02:53:25 +00:00
|
|
|
export default function SectionWrapper({
|
|
|
|
component,
|
|
|
|
outerContainerSx: sx,
|
|
|
|
sx: innerSx,
|
|
|
|
children,
|
|
|
|
maxWidth,
|
|
|
|
}: Props) {
|
|
|
|
const theme = useTheme();
|
|
|
|
const matchMd = useMediaQuery(theme.breakpoints.up("md"));
|
2022-12-09 11:48:15 +00:00
|
|
|
|
2023-12-31 02:53:25 +00:00
|
|
|
return (
|
|
|
|
<Container
|
|
|
|
component={component || "div"}
|
|
|
|
maxWidth={false}
|
|
|
|
disableGutters
|
|
|
|
sx={sx}
|
|
|
|
>
|
|
|
|
<Container
|
|
|
|
disableGutters
|
|
|
|
maxWidth={maxWidth}
|
|
|
|
sx={{
|
|
|
|
px: matchMd ? "20px" : "0px",
|
|
|
|
...innerSx,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</Container>
|
|
|
|
</Container>
|
|
|
|
);
|
|
|
|
}
|