"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _styledModalComponents = require("../styledModalComponents");
var _StyledInput = _interopRequireDefault(require("../../styled/StyledInput"));
var _Select = _interopRequireDefault(require("../../MainComponents/Select"));
var _Button = _interopRequireDefault(require("../../styled/Button"));
var _UsersList = _interopRequireDefault(require("../../UsersList/UsersList"));
var _ProfileImagePlaceholder = require("../../MainComponents/ProfileImagePlaceholder");
var _icons = require("../../../assets/icons");
var _reactNative = require("react-native");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const ModalContent = ({
  activeTab,
  roomName,
  roomDescription,
  chatType,
  profileImage,
  setActiveTab,
  handleRoomNameChange,
  setChatType,
  setProfileImage,
  selectedUsers,
  setSelectedUsers,
  handleCreateRoom,
  handleCloseModal,
  errors,
  setErrors,
  options
}) => {
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledModalComponents.ModalContainer, {
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.CloseButton, {
      onPress: handleCloseModal,
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
        style: {
          fontSize: 24
        },
        children: "\xD7"
      })
    }), activeTab === '0' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.ModalTitle, {
        children: "Create New Chat"
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProfileImagePlaceholder.ProfileImagePlaceholder, {
        size: 120,
        upload: {
          active: true,
          onUpload: setProfileImage
        },
        remove: {
          enabled: true,
          onRemoveClick: () => setProfileImage(null)
        },
        placeholderIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.AddPhotoIcon, {}),
        icon: profileImage,
        disableOverlay: !profileImage,
        role: "user"
      }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledModalComponents.GroupContainer, {
        style: {
          flexDirection: 'column',
          position: 'relative',
          width: '100%'
        },
        children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_StyledInput.default, {
          style: {
            flex: 1
          },
          id: "roomName",
          value: roomName,
          onChange: handleRoomNameChange,
          placeholder: "Enter Room Name",
          helperText: errors.name,
          error: !!errors.name
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
          options: options,
          onSelect: setChatType,
          selectedValue: chatType,
          placeholder: 'Select room type'
        })]
      }), chatType.id === 'group' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
        onPress: () => setActiveTab('1'),
        style: {
          width: '100%'
        },
        variant: "outlined",
        unstyled: true,
        children: "Add users"
      }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledModalComponents.GroupContainer, {
        children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
          onPress: handleCloseModal,
          text: 'Cancel',
          style: {
            width: '100%'
          },
          unstyled: true,
          variant: "outlined"
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
          onPress: handleCreateRoom,
          text: 'Create',
          style: {
            width: '100%'
          },
          variant: "filled"
        })]
      })]
    }), activeTab === '1' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.ModalTitle, {
        children: "Select users to add to Chat"
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_UsersList.default, {
        selectedUsers: selectedUsers,
        setSelectedUsers: setSelectedUsers,
        style: {
          minHeight: '400px',
          minWidth: '100%',
          width: '100%'
        }
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
        onPress: () => setActiveTab('0'),
        style: {
          width: '100%'
        },
        variant: "outlined",
        unstyled: true,
        children: "Back to creation"
      })]
    })]
  });
};
var _default = exports.default = ModalContent;
//# sourceMappingURL=ModalContent.js.map