'use strict';

var jsxRuntime = require('react/jsx-runtime');
var react = require('@chakra-ui/react');

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

module.exports = BaseModal;
//# sourceMappingURL=Modal.cjs.map
