"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ModalWrapper = void 0;
var _react = require("react");
var _styledModalComponents = require("../styledModalComponents");
var _Button = _interopRequireDefault(require("../../styled/Button"));
var _reactNative = require("react-native");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const ModalWrapper = ({
  iconTitle: IconTitle,
  title,
  description,
  buttonText,
  backgroundColorButton,
  isTextarea,
  textarea,
  setTextarea,
  handleCloseModal,
  handleClick
}) => {
  const textareaRef = (0, _react.useRef)(null);

  // const handleInput = () => {
  //   const textarea = textareaRef.current;
  //   if (textarea) {
  //     textarea.style.height = "auto";
  //     textarea.style.height = `${textarea.scrollHeight}px`;
  //   }
  // };

  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
    transparent: true,
    animationType: "fade",
    visible: true,
    onRequestClose: handleCloseModal,
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.ModalBackground, {
      children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledModalComponents.ModalContainer, {
        style: {
          maxWidth: 640
        },
        children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.CloseButton, {
          onPress: handleCloseModal,
          children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
            style: {
              fontSize: 24
            },
            children: "\xD7"
          })
        }), IconTitle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(IconTitle, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.ModalTitle, {
          children: title
        }), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.ModalDescription, {
          children: description
        }), isTextarea && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.GroupContainer, {
          style: {
            flexDirection: 'column',
            position: 'relative'
          }
        }), !buttonText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.GroupContainer, {}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledModalComponents.GroupContainer, {
          children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
            onPress: handleCloseModal,
            text: 'Cancel',
            style: {
              width: '100%'
            },
            unstyled: true,
            variant: "outlined"
          }), buttonText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
            onPress: handleClick,
            text: buttonText,
            style: {
              width: '100%',
              backgroundColor: backgroundColorButton
            },
            unstyled: true,
            variant: "filled"
          })]
        })]
      })
    })
  });
};
exports.ModalWrapper = ModalWrapper;
//# sourceMappingURL=ModalWrapper.js.map