import { jsxs, jsx } from 'react/jsx-runtime';
import { Modal, ModalOverlay, ModalContent, ModalHeader, ModalCloseButton, ModalBody } from '@chakra-ui/react';

const BaseModal = ({
  isClosable = true,
  isOpen = false,
  heading,
  onClose,
  children,
  size
}) => /* @__PURE__ */ jsxs(
  Modal,
  {
    onClose,
    isOpen,
    isCentered: true,
    closeOnOverlayClick: isClosable,
    closeOnEsc: isClosable,
    size,
    children: [
      /* @__PURE__ */ jsx(ModalOverlay, {}),
      /* @__PURE__ */ jsxs(ModalContent, { children: [
        /* @__PURE__ */ jsx(ModalHeader, { "data-testid": "modal-heading", children: heading }),
        isClosable ? /* @__PURE__ */ jsx(ModalCloseButton, { "data-testid": "modal-close-button", onClick: onClose }) : null,
        /* @__PURE__ */ jsx(ModalBody, { "data-testid": "modal-body", mb: 4, children })
      ] })
    ]
  }
);

export { BaseModal as default };
//# sourceMappingURL=Modal.js.map
