import React__default, { useContext } from 'react';
import Avatar from '../../ui/Avatar.js';
import Icon, { IconColors, IconTypes } from '../../ui/Icon.js';
import IconButton from '../../ui/IconButton.js';
import { L as Label, a as LabelTypography, b as LabelColors } from '../../index-4372fcec.js';
import { a as LocalizationContext } from '../../LocalizationContext-b2390bf8.js';
import { u as useOpenChannelContext, k as kFormatter } from '../../OpenChannelProvider-d0f0bf3a.js';
import { u as useMediaQueryContext } from '../../MediaQueryContext-b4904a2e.js';
import '../../ui/ImageRenderer.js';
import '../../uuid-a79b5ba8.js';
import 'prop-types';
import '../../_rollupPluginBabelHelpers-4f8ebde4.js';
import '../../stringSet-eefbc798.js';
import '../../index-67135027.js';
import '../../index-2dc53ac2.js';
import '../../UserProfileContext-d5787c95.js';
import '../../compareIds-7800035f.js';
import '../../topics-f3629ea0.js';
import '@sendbird/chat';
import '@sendbird/chat/openChannel';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';

function OpenchannelConversationHeader() {
  const {
    stringSet
  } = useContext(LocalizationContext);
  const {
    currentOpenChannel,
    onChatHeaderActionClick,
    amIOperator,
    onBackClick
  } = useOpenChannelContext();
  const title = currentOpenChannel === null || currentOpenChannel === void 0 ? void 0 : currentOpenChannel.name;
  const subTitle = `${kFormatter(currentOpenChannel === null || currentOpenChannel === void 0 ? void 0 : currentOpenChannel.participantCount)} ${stringSet.OPEN_CHANNEL_CONVERSATION__TITLE_PARTICIPANTS}`;
  const coverImage = currentOpenChannel === null || currentOpenChannel === void 0 ? void 0 : currentOpenChannel.coverUrl;
  const {
    isMobile
  } = useMediaQueryContext();
  return /*#__PURE__*/React__default.createElement("div", {
    className: "sendbird-openchannel-conversation-header"
  }, /*#__PURE__*/React__default.createElement("div", {
    className: "sendbird-openchannel-conversation-header__left"
  }, isMobile && /*#__PURE__*/React__default.createElement(Icon, {
    className: "sendbird-oepnchannel-header__icon_back",
    onClick: onBackClick,
    fillColor: IconColors.PRIMARY,
    width: "24px",
    height: "24px",
    type: IconTypes.ARROW_LEFT
  }), coverImage ? /*#__PURE__*/React__default.createElement(Avatar, {
    className: "sendbird-openchannel-conversation-header__left__cover-image",
    src: coverImage,
    alt: "channel cover image",
    width: "32px",
    height: "32px"
  }) : /*#__PURE__*/React__default.createElement("div", {
    className: "sendbird-openchannel-conversation-header__left__cover-image--icon",
    style: {
      width: 32,
      height: 32
    }
  }, /*#__PURE__*/React__default.createElement(Icon, {
    type: IconTypes.CHANNELS,
    fillColor: IconColors.CONTENT,
    width: "18px",
    height: "18px"
  })), /*#__PURE__*/React__default.createElement(Label, {
    className: "sendbird-openchannel-conversation-header__left__title",
    type: LabelTypography.H_2,
    color: LabelColors.ONBACKGROUND_1
  }, title || stringSet.NO_TITLE), /*#__PURE__*/React__default.createElement(Label, {
    className: "sendbird-openchannel-conversation-header__left__sub-title",
    type: LabelTypography.BODY_2,
    color: LabelColors.ONBACKGROUND_2
  }, subTitle || stringSet.NO_TITLE)), /*#__PURE__*/React__default.createElement("div", {
    className: "sendbird-openchannel-conversation-header__right"
  }, /*#__PURE__*/React__default.createElement(IconButton, {
    className: "sendbird-openchannel-conversation-header__right__trigger",
    width: "32px",
    height: "32px",
    onClick: onChatHeaderActionClick
  }, /*#__PURE__*/React__default.createElement(Icon, {
    type: amIOperator ? IconTypes.INFO : IconTypes.MEMBERS,
    fillColor: IconColors.PRIMARY,
    width: "24px",
    height: "24px"
  }))));
}

export { OpenchannelConversationHeader as default };
//# sourceMappingURL=OpenChannelHeader.js.map
