import React__default, { useContext, useMemo } from 'react';
import Avatar from './Avatar.js';
import { a as LocalizationContext } from '../LocalizationContext-1701e5c8.js';
import { b as getOpenChannelAvatar } from '../utils-cd7ab927.js';
import './ImageRenderer.js';
import './Icon.js';
import 'prop-types';
import '../uuid-8b344dd2.js';
import '../stringSet-e9bb0333.js';
import '../index-ff8f2f61.js';

function ChannelAvatar(_ref) {
  let {
    channel,
    theme,
    height = 56,
    width = 56
  } = _ref;
  const {
    stringSet
  } = useContext(LocalizationContext);
  const memoizedAvatar = useMemo(() => {
    return /*#__PURE__*/React__default.createElement(Avatar, {
      className: "sendbird-chat-header__avatar--open-channel",
      src: getOpenChannelAvatar(channel),
      width: `${width}px`,
      height: `${height}px`,
      alt: (channel === null || channel === void 0 ? void 0 : channel.name) || stringSet.OPEN_CHANNEL_SETTINGS__NO_TITLE
    });
  }, [channel === null || channel === void 0 ? void 0 : channel.coverUrl, theme]);
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, memoizedAvatar);
}

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