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-c1d2f942.js';
import '../../_rollupPluginBabelHelpers-b2d9bfc5.js';
import 'prop-types';
import '../../CreateChannel/components/CreateChannelUI.js';
import '../../CreateChannelProvider-d2188082.js';
import '../../sendbirdSelectors.js';
import '../../topics-d8d10f83.js';
import '../../utils-0c09801e.js';
import '../../CreateChannel/components/InviteUsers.js';
import '../../LocalizationContext-9c54e783.js';
import '../../stringSet-1f18348a.js';
import '../../index-a9ddd0f5.js';
import '../../ui/Modal.js';
import 'react-dom';
import '../../index-2a938266.js';
import '../../ui/Button.js';
import '../../index-4111594a.js';
import '../../MediaQueryContext-1988a4bc.js';
import '../../ui/UserListItem.js';
import '../../UserProfileContext-a8aa4c0f.js';
import '../../ui/Avatar.js';
import '../../ui/ImageRenderer.js';
import '../../uuid-48baadaf.js';
import '../../ui/MutedAvatarOverlay.js';
import '../../ui/Checkbox.js';
import '../../ui/UserProfile.js';
import '../../ui/ContextMenu.js';
import '../../ui/SortByRow.js';
import '../../index-dbe0e004.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../CreateChannel/components/SelectChannelType.js';
import '../../withSendbird.js';
import '@sendbird/chat/groupChannel';

const AddChannel = () => {
  var _state$config;
  const [showModal, setShowModal] = useState(false);
  const state = useSendbirdStateContext();
  const isOnline = state === null || state === void 0 ? void 0 : (_state$config = state.config) === null || _state$config === void 0 ? void 0 : _state$config.isOnline;
  const disabled = !isOnline;
  const {
    overrideInviteUser,
    onBeforeCreateChannel
  } = useChannelListContext();
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(IconButton, {
    height: "32px",
    width: "32px",
    onClick: () => {
      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: () => {
      setShowModal(false);
    },
    overrideInviteUser: overrideInviteUser,
    onCreateChannel: () => {
      setShowModal(false);
    },
    onBeforeCreateChannel: onBeforeCreateChannel
  }));
};

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