import { Box, Modal } from "@mui/material";
import DrawerContainer, { DrawerContainerProps } from "../DrawerContainer";

interface ModalProps extends DrawerContainerProps {
  visible: boolean;
}
export default function SaturnModal({
  visible,
  width = 500,
  children,
  ...containerProps
}: ModalProps) {
  return (
    <Modal
      open={visible}
      onClose={containerProps.onCancel}
      closeAfterTransition
    >
      <Box style={{ width: "100%", height: "100%" }}>
        <DrawerContainer
          {...containerProps}
          width={width}
          style={{ marginTop: 50, ...containerProps.style }}
        >
          {children}
        </DrawerContainer>
      </Box>
    </Modal>
  );
}
