'use strict';

var React = require('react');
var ui_MessageStatus = require('../../chunks/bundle-BFKxvlzn.js');
var LocalizationContext = require('../../chunks/bundle-DDNdw3A9.js');
var GroupChannelListItemView = require('../../chunks/bundle-Y1fPW7ES.js');
var GroupChannelListProvider = require('../../chunks/bundle-CpzjjrHg.js');
var useSendbird = require('../../chunks/bundle-LI9JjqG2.js');
require('../../chunks/bundle-CxoFSSXv.js');
require('../../chunks/bundle-FJtjwZwh.js');
require('../../chunks/bundle-C1G0SKDq.js');
require('../../chunks/bundle-BV7y6VDn.js');
require('../../ui/Icon.js');
require('../../chunks/bundle-DQNu-S6D.js');
require('../../chunks/bundle-B0UICprZ.js');
require('../../chunks/bundle-EhtiN7UV.js');
require('../../ui/Loader.js');
require('../../chunks/bundle-D7YiKR6i.js');
require('@sendbird/chat/groupChannel');
require('../../utils/message/getOutgoingMessageState.js');
require('../../chunks/bundle-dfqZUdij.js');
require('../../chunks/bundle-Dn0hi6OJ.js');
require('../../chunks/bundle-yU9Mr2pS.js');
require('../../chunks/bundle-CBLzrxjV.js');
require('../../chunks/bundle-B9BY1g5d.js');
require('../../chunks/bundle-Bd-cNaJc.js');
require('../../chunks/bundle-CyQD5TkW.js');
require('../../GroupChannel/components/TypingIndicator.js');
require('../../chunks/bundle-BUGwK1WK.js');
require('../../chunks/bundle-AAO7jUU2.js');
require('@sendbird/chat');
require('@sendbird/chat/openChannel');
require('../../ui/Badge.js');
require('../../ui/ChannelAvatar.js');
require('../../chunks/bundle-CLL-nCFU.js');
require('../../ui/ImageRenderer.js');
require('../../chunks/bundle-C8MACRPO.js');
require('../../chunks/bundle-DAVPwIxJ.js');
require('../../ui/MentionUserLabel.js');
require('../../chunks/bundle-za5uPkdP.js');
require('../../chunks/bundle-YeW89zsR.js');
require('react-dom');
require('../../ui/IconButton.js');
require('../../ui/Button.js');
require('../../ui/TextButton.js');
require('../../chunks/bundle-BIrmQghI.js');
require('../../chunks/bundle-CXHWkhsI.js');
require('@sendbird/uikit-tools');
require('../../chunks/bundle-DeyX1dvY.js');
require('../../chunks/bundle-ys65nyET.js');
require('../../chunks/bundle-ChpcAmBg.js');

function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefaultCompat(React);

var GroupChannelListItem = function (_a) {
    var _b, _c, _d;
    var channel = _a.channel, isSelected = _a.isSelected, isTyping = _a.isTyping, renderChannelAction = _a.renderChannelAction, onLeaveChannel = _a.onLeaveChannel, onClick = _a.onClick, tabIndex = _a.tabIndex;
    var config = useSendbird.useSendbird().state.config;
    var stringSet = LocalizationContext.useLocalization().stringSet;
    var _e = GroupChannelListProvider.useGroupChannelList().state, isTypingIndicatorEnabled = _e.isTypingIndicatorEnabled, isMessageReceiptStatusEnabled = _e.isMessageReceiptStatusEnabled;
    var userId = config.userId;
    var isMessageStatusEnabled = isMessageReceiptStatusEnabled
        && (!((_b = channel.lastMessage) === null || _b === void 0 ? void 0 : _b.isAdminMessage()))
        && ((_d = (_c = channel.lastMessage) === null || _c === void 0 ? void 0 : _c.sender) === null || _d === void 0 ? void 0 : _d.userId) === userId;
    return (React__default.default.createElement(GroupChannelListItemView.GroupChannelListItemView, { channel: channel, tabIndex: tabIndex, channelName: ui_MessageStatus.getChannelTitle(channel, userId, stringSet), isTyping: isTypingIndicatorEnabled && isTyping, isSelected: isSelected, isMessageStatusEnabled: isMessageStatusEnabled, onClick: onClick, onLeaveChannel: onLeaveChannel, renderChannelAction: renderChannelAction }));
};

exports.GroupChannelListItem = GroupChannelListItem;
//# sourceMappingURL=GroupChannelListItem.js.map
