import React__default, { useMemo } from 'react';
import IconButton from '../../ui/IconButton.js';
import Icon, { IconTypes, IconColors } from '../../ui/Icon.js';
import { L as Label, a as LabelTypography, b as LabelColors } from '../../index-4372fcec.js';
import TextButton from '../../ui/TextButton.js';
import { u as useLocalization } from '../../LocalizationContext-b2390bf8.js';
import '../../_rollupPluginBabelHelpers-4f8ebde4.js';
import 'prop-types';
import '../../stringSet-eefbc798.js';
import '../../color-9519a526.js';
import '../../index-67135027.js';

function ThreadHeader(_ref) {
  let {
    className,
    channelName,
    renderActionIcon,
    onActionIconClick,
    onChannelNameClick
  } = _ref;
  const {
    stringSet
  } = useLocalization();
  const MemoizedActionIcon = useMemo(() => {
    if (typeof renderActionIcon === 'function') {
      return renderActionIcon({
        onActionIconClick
      });
    }
    return null;
  }, [renderActionIcon]);
  return /*#__PURE__*/React__default.createElement("div", {
    className: `sendbird-thread-header ${className}`
  }, /*#__PURE__*/React__default.createElement(Label, {
    className: "sendbird-thread-header__title",
    type: LabelTypography.H_2,
    color: LabelColors.ONBACKGROUND_1
  }, stringSet.THREAD__HEADER_TITLE), /*#__PURE__*/React__default.createElement(TextButton, {
    onClick: e => onChannelNameClick === null || onChannelNameClick === void 0 ? void 0 : onChannelNameClick(e),
    disableUnderline: true
  }, /*#__PURE__*/React__default.createElement(Label, {
    className: "sendbird-thread-header__channel-name",
    type: LabelTypography.CAPTION_3,
    color: LabelColors.ONBACKGROUND_2
  }, channelName)), MemoizedActionIcon || /*#__PURE__*/React__default.createElement("div", {
    className: "sendbird-thread-header__action"
  }, /*#__PURE__*/React__default.createElement(IconButton, {
    width: "32px",
    height: "32px",
    onClick: e => onActionIconClick(e)
  }, /*#__PURE__*/React__default.createElement(Icon, {
    type: IconTypes.CLOSE,
    fillColor: IconColors.ON_BACKGROUND_1,
    width: "22px",
    height: "22px"
  }))));
}

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