import React__default, { useState } from 'react';
import IconButton from '../../ui/IconButton.js';
import Icon, { IconTypes, IconColors } from '../../ui/Icon.js';
import CreateChannel from '../../CreateChannel.js';
import useSendbirdStateContext from '../../useSendbirdStateContext.js';
import '../../tslib.es6-7933cbb3.js';
import 'prop-types';
import '../../CreateChannel/components/CreateChannelUI.js';
import '../../CreateChannelProvider-eb0e903a.js';
import '../../sendbirdSelectors.js';
import '../../topics-0034d31d.js';
import '../../utils-be67dd33.js';
import '../../CreateChannel/components/InviteUsers.js';
import '../../LocalizationContext-a21fd99c.js';
import '../../stringSet-97b371bf.js';
import '../../index-2f7dc394.js';
import '../../ui/Modal.js';
import 'react-dom';
import '../../index-acdeddcd.js';
import '../../ui/Button.js';
import '../../index-4572759d.js';
import '../../ui/UserListItem.js';
import '../../UserProfileContext-804d6e7c.js';
import '../../ui/Avatar.js';
import '../../ui/ImageRenderer.js';
import '../../uuid-0426c252.js';
import '../../ui/MutedAvatarOverlay.js';
import '../../ui/Checkbox.js';
import '../../ui/UserProfile.js';
import '../../withSendbird.js';
import '../../_rollupPluginBabelHelpers-3be2ec67.js';
import '../../ui/ContextMenu.js';
import '../../ui/SortByRow.js';
import '../../index-c35128dd.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../CreateChannel/components/SelectChannelType.js';

var AddChannel = function () {
  var _a;

  var _b = useState(false),
      showModal = _b[0],
      setShowModal = _b[1];

  var state = useSendbirdStateContext();
  var isOnline = (_a = state === null || state === void 0 ? void 0 : state.config) === null || _a === void 0 ? void 0 : _a.isOnline;
  var disabled = !isOnline;
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(IconButton, {
    height: "32px",
    width: "32px",
    onClick: function () {
      setShowModal(true);
    },
    disabled: disabled
  }, /*#__PURE__*/React__default.createElement(Icon, {
    type: IconTypes.CREATE,
    fillColor: IconColors.PRIMARY,
    width: "24px",
    height: "24px"
  })), showModal && /*#__PURE__*/React__default.createElement(CreateChannel, {
    onCancel: function () {
      setShowModal(false);
    },
    onCreateChannel: function () {
      setShowModal(false);
    }
  }));
};

export { AddChannel, AddChannel as default };
//# sourceMappingURL=AddChannel.js.map
