'use strict';

var React = require('react');
var ui_MessageStatus = require('../../chunks/bundle-DO5FgbkI.js');
var LocalizationContext = require('../../chunks/bundle-DPDyqKIJ.js');
var GroupChannelListItemView = require('../../chunks/bundle-CYACBqrn.js');
var GroupChannelListProvider = require('../../chunks/bundle-BzCZ_Let.js');
var useSendbird = require('../../chunks/bundle-Bq15P9qk.js');
require('../../chunks/bundle-Conb-pOy.js');
require('../../chunks/bundle-CHAKEXIJ.js');
require('../../chunks/bundle-CVJwHwWn.js');
require('../../chunks/bundle-Cyl6_qLo.js');
require('../../ui/Icon.js');
require('../../chunks/bundle-CkQrhwR6.js');
require('../../chunks/bundle-zgmRG2KL.js');
require('../../chunks/bundle-BbrBawlX.js');
require('../../ui/Loader.js');
require('../../chunks/bundle-fYxs1lss.js');
require('@sendbird/chat/groupChannel');
require('../../utils/message/getOutgoingMessageState.js');
require('../../chunks/bundle-DAdgL6r8.js');
require('../../chunks/bundle-Dobj18FB.js');
require('../../chunks/bundle-Cfh78Xnm.js');
require('../../chunks/bundle-ptQgj0WJ.js');
require('../../chunks/bundle-DQaXgp8o.js');
require('../../chunks/bundle-C5p82xwC.js');
require('../../chunks/bundle-Fv6PNPGZ.js');
require('../../GroupChannel/components/TypingIndicator.js');
require('../../chunks/bundle-t8BQsgL5.js');
require('../../chunks/bundle-B19RHFpR.js');
require('@sendbird/chat');
require('@sendbird/chat/openChannel');
require('../../ui/Badge.js');
require('../../ui/ChannelAvatar.js');
require('../../chunks/bundle-B7KG10z2.js');
require('../../ui/ImageRenderer.js');
require('../../chunks/bundle-C99t7tzf.js');
require('../../chunks/bundle-Bvjprr6O.js');
require('../../ui/MentionUserLabel.js');
require('../../chunks/bundle-DHuNGmIj.js');
require('../../chunks/bundle-DZlJeh0V.js');
require('react-dom');
require('../../ui/IconButton.js');
require('../../ui/Button.js');
require('../../ui/TextButton.js');
require('../../chunks/bundle-DurllD3r.js');
require('../../chunks/bundle-CzkEKbFB.js');
require('@sendbird/uikit-tools');
require('../../chunks/bundle-Bnb8seJF.js');
require('../../chunks/bundle-Dhgx-4nj.js');
require('../../chunks/bundle-CxArG0ag.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
