import React__default from 'react';
import { u as useLocalization } from '../../chunks/bundle-Del33VzI.js';
import { u as useChannelListContext } from '../../chunks/bundle-XQQB24FY.js';
import { g as getChannelTitle } from '../../chunks/bundle-2U8QpYXo.js';
import { G as GroupChannelListItemView } from '../../chunks/bundle-CVD_LLYN.js';
import { u as useSendbird } from '../../chunks/bundle-i_3w58Zd.js';
import '../../chunks/bundle-yl5d1NoZ.js';
import '../../chunks/bundle-C1dqPUnT.js';
import '../../chunks/bundle-BZGITC2g.js';
import '@sendbird/chat/groupChannel';
import '../../chunks/bundle-BOykFtQ3.js';
import '../../chunks/bundle-DGh2T5IL.js';
import '../../chunks/bundle-MlG9piGf.js';
import '../../chunks/bundle-CqLLOVG5.js';
import '../../chunks/bundle-B0s_McF0.js';
import '../../chunks/bundle-DEuCwnTn.js';
import '../../chunks/bundle-vmZ9LoYK.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../chunks/bundle-DgosLQK9.js';
import '../../chunks/bundle-fdEQfX2s.js';
import '../../chunks/bundle-C-onA3TP.js';
import '../../chunks/bundle-mGsud0ec.js';
import '../../ui/Icon.js';
import '../../chunks/bundle-viBng0Kh.js';
import '../../ui/Loader.js';
import '../../chunks/bundle-BhhLSKSz.js';
import '../../chunks/bundle-Cl9rtdlj.js';
import '../../chunks/bundle-Ba_cV-Zm.js';
import '../../chunks/bundle-DBhJIxHw.js';
import '../../GroupChannel/components/TypingIndicator.js';
import '../../ui/Badge.js';
import '../../ui/ChannelAvatar.js';
import '../../chunks/bundle-CAEBoiEz.js';
import '../../ui/ImageRenderer.js';
import '../../chunks/bundle-Dl_v8XoN.js';
import '../../chunks/bundle-B2BBbSEN.js';
import '../../ui/MentionUserLabel.js';
import '../../chunks/bundle-D6b2YGeE.js';
import '../../chunks/bundle-CtQtfJlT.js';
import 'react-dom';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '../../ui/TextButton.js';
import '../../chunks/bundle-Bokm7tQ9.js';
import '../../chunks/bundle-BwvurfUT.js';
import '../../chunks/bundle-BUYU9H94.js';
import '@sendbird/chat';
import '@sendbird/chat/openChannel';

/**
 * @deprecated This component is deprecated and will be removed in the next major update.
 * Please use the `GroupChannel` component from '@sendbird/uikit-react/GroupChannel' instead.
 * For more information, please refer to the migration guide:
 * https://docs.sendbird.com/docs/chat/uikit/v3/react/introduction/group-channel-migration-guide
 */
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 state = useSendbird().state;
    var config = state.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
