2023-12-31 02:53:25 +00:00
|
|
|
import * as React from "react";
|
|
|
|
import Box from "@mui/material/Box";
|
|
|
|
import Drawer from "@mui/material/Drawer";
|
|
|
|
import Button from "@mui/material/Button";
|
2024-01-04 21:56:21 +00:00
|
|
|
import { SxProps, Theme, useMediaQuery, useTheme } from "@mui/material";
|
2023-04-17 02:27:22 +00:00
|
|
|
|
|
|
|
interface Props {
|
2023-12-31 02:53:25 +00:00
|
|
|
outerContainerSx?: SxProps<Theme>;
|
|
|
|
children?: React.ReactNode;
|
|
|
|
isOpenDrawer: string;
|
|
|
|
drawerNewFieldHC: (str: string) => void;
|
2023-04-17 02:27:22 +00:00
|
|
|
}
|
|
|
|
|
2023-12-31 02:53:25 +00:00
|
|
|
export default function DrawerNewField({
|
|
|
|
outerContainerSx: sx,
|
|
|
|
children,
|
|
|
|
isOpenDrawer: isOpen,
|
|
|
|
drawerNewFieldHC,
|
|
|
|
}: Props) {
|
2024-01-04 21:56:21 +00:00
|
|
|
const theme = useTheme();
|
|
|
|
const isMobile = useMediaQuery(theme.breakpoints.down(600));
|
2023-12-31 02:53:25 +00:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Drawer
|
|
|
|
anchor="right"
|
|
|
|
open={Boolean(isOpen)}
|
|
|
|
onClose={() => drawerNewFieldHC("")}
|
|
|
|
>
|
2024-01-04 21:56:21 +00:00
|
|
|
<Box sx={{ width: isMobile ? 320 : 450 }} role="presentation">
|
2023-12-31 02:53:25 +00:00
|
|
|
{children}
|
|
|
|
</Box>
|
|
|
|
</Drawer>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|