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 { u as useChannelListContext } from '../../ChannelListProvider-43f3a74a.js';
import '../../tslib.es6-cd680863.js';
import 'prop-types';
import '../../CreateChannel/components/CreateChannelUI.js';
import '../../CreateChannelProvider-763b1601.js';
import '../../sendbirdSelectors.js';
import '../../topics-9fbe0d61.js';
import '../../utils-aae15fda.js';
import '../../CreateChannel/components/InviteUsers.js';
import '../../LocalizationContext-a6aa8be8.js';
import '../../stringSet-ad8993d1.js';
import '../../index-757a563a.js';
import '../../ui/Modal.js';
import 'react-dom';
import '../../index-d4908e3c.js';
import '../../ui/Button.js';
import '../../index-67c5e94c.js';
import '../../MediaQueryContext-a551e770.js';
import '../../ui/UserListItem.js';
import '../../UserProfileContext-dd096494.js';
import '../../ui/Avatar.js';
import '../../ui/ImageRenderer.js';
import '../../uuid-9f7da91d.js';
import '../../ui/MutedAvatarOverlay.js';
import '../../ui/Checkbox.js';
import '../../ui/UserProfile.js';
import '../../ui/ContextMenu.js';
import '../../ui/SortByRow.js';
import '../../index-8ee9e1f5.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../CreateChannel/components/SelectChannelType.js';
import '../../withSendbird.js';
import '../../_rollupPluginBabelHelpers-3e5825fa.js';
import '@sendbird/chat/groupChannel';

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;
  var overrideInviteUser = useChannelListContext().overrideInviteUser;
  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);
    },
    overrideInviteUser: overrideInviteUser,
    onCreateChannel: function () {
      setShowModal(false);
    }
  }));
};

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