import React__default from 'react';
import { useSendbirdStateContext } from '../../useSendbirdStateContext.js';
import { u as useLocalization } from '../../chunks/bundle-Bx5vhTbU.js';
import { u as useChannelListContext } from '../../chunks/bundle-BmTGlIgs.js';
import { g as getChannelTitle } from '../../chunks/bundle-DJTSztr0.js';
import { G as GroupChannelListItemView } from '../../chunks/bundle-fRP_rTVb.js';
import '../../withSendbird.js';
import '../../chunks/bundle-7oF7KbGv.js';
import '../../chunks/bundle-C8im5l9B.js';
import '../../chunks/bundle-C1ds4cil.js';
import '@sendbird/chat/groupChannel';
import '../../chunks/bundle-BWuyd0AD.js';
import '../../chunks/bundle-BJ46V6XQ.js';
import '../../chunks/bundle-ByvmbZD0.js';
import '../../chunks/bundle-CD9AzC6s.js';
import '../../chunks/bundle-B7barEsR.js';
import '../../chunks/bundle-BWCGFXhj.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../chunks/bundle-dC3DwujZ.js';
import '../../chunks/bundle-C040958G.js';
import '../../ui/Icon.js';
import '../../chunks/bundle-LYAWKk4n.js';
import '../../ui/Loader.js';
import '../../chunks/bundle-yZ1rqvSQ.js';
import '../../chunks/bundle-CaaUNO3F.js';
import '../../chunks/bundle-Gx0ryc_f.js';
import '../../chunks/bundle-Diqj6For.js';
import '../../GroupChannel/components/TypingIndicator.js';
import '../../ui/Badge.js';
import '../../ui/ChannelAvatar.js';
import '../../chunks/bundle-CNJMLyGJ.js';
import '../../ui/ImageRenderer.js';
import '../../chunks/bundle-CT8ZXUi2.js';
import '../../chunks/bundle-_-vntp1z.js';
import '../../ui/MentionUserLabel.js';
import '../../chunks/bundle-B5N2u5f-.js';
import '../../chunks/bundle-C4Z-NWqF.js';
import 'react-dom';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '@sendbird/uikit-tools';
import 'css-vars-ponyfill';
import '@sendbird/chat';
import '@sendbird/chat/openChannel';
import '../../chunks/bundle-CIwVkd-E.js';
import '../../chunks/bundle-BbWD2VuS.js';
import '../../ui/TextButton.js';
import '../../chunks/bundle-HoQqraNc.js';

var ChannelPreview = function (_a) {
    var _b, _c, _d, _e;
    var channel = _a.channel, _f = _a.isActive, isActive = _f === void 0 ? false : _f, _g = _a.isSelected, isSelected = _g === void 0 ? false : _g, _h = _a.isTyping, isTyping = _h === void 0 ? false : _h, renderChannelAction = _a.renderChannelAction, onLeaveChannel = _a.onLeaveChannel, onClick = _a.onClick, tabIndex = _a.tabIndex;
    var config = useSendbirdStateContext().config;
    var stringSet = useLocalization().stringSet;
    var _j = useChannelListContext(), _k = _j.isTypingIndicatorEnabled, isTypingIndicatorEnabled = _k === void 0 ? false : _k, _l = _j.isMessageReceiptStatusEnabled, isMessageReceiptStatusEnabled = _l === void 0 ? false : _l;
    var userId = config.userId;
    var isMessageStatusEnabled = isMessageReceiptStatusEnabled
        && (((_b = channel === null || channel === void 0 ? void 0 : channel.lastMessage) === null || _b === void 0 ? void 0 : _b.messageType) === 'user' || ((_c = channel === null || channel === void 0 ? void 0 : channel.lastMessage) === null || _c === void 0 ? void 0 : _c.messageType) === 'file')
        && ((_e = (_d = channel === null || channel === void 0 ? void 0 : channel.lastMessage) === null || _d === void 0 ? void 0 : _d.sender) === null || _e === void 0 ? void 0 : _e.userId) === userId;
    return (React__default.createElement(GroupChannelListItemView, { channel: channel, tabIndex: tabIndex, isTyping: isTypingIndicatorEnabled && isTyping, isSelected: isSelected !== null && isSelected !== void 0 ? isSelected : isActive, channelName: getChannelTitle(channel, userId, stringSet), isMessageStatusEnabled: isMessageStatusEnabled, onClick: onClick, onLeaveChannel: onLeaveChannel, renderChannelAction: renderChannelAction }));
};

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