import React__default, { useState } from 'react';
import { u as useChannelSettings } from '../../chunks/bundle-CvsU5rx0.js';
import { u as useLocalization } from '../../chunks/bundle-Del33VzI.js';
import Badge from '../../ui/Badge.js';
import { L as Label, a as LabelTypography, b as LabelColors } from '../../chunks/bundle-viBng0Kh.js';
import Icon, { IconTypes, IconColors } from '../../ui/Icon.js';
import { M as MemberList } from '../../chunks/bundle-g_iPnYTz.js';
import '../../chunks/bundle-yl5d1NoZ.js';
import '../../chunks/bundle-BUYU9H94.js';
import '../../chunks/bundle-CqLLOVG5.js';
import '@sendbird/chat/groupChannel';
import '../../chunks/bundle-DGh2T5IL.js';
import '../../chunks/bundle-CM73CDTO.js';
import '../../chunks/bundle-MlG9piGf.js';
import '../../chunks/bundle-B0s_McF0.js';
import '../../chunks/bundle-i_3w58Zd.js';
import '@sendbird/chat';
import '@sendbird/chat/openChannel';
import '../../chunks/bundle-C1dqPUnT.js';
import '../../chunks/bundle-BZGITC2g.js';
import '../../ui/Button.js';
import '../../chunks/bundle-0vQ6L6RB.js';
import '../../chunks/bundle-Bch_Ry4S.js';
import 'react-dom';
import '../../ui/SortByRow.js';
import '../../ui/IconButton.js';
import '../../chunks/bundle-vmZ9LoYK.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../chunks/bundle-DgosLQK9.js';
import '../../chunks/bundle-DEuCwnTn.js';
import '../../chunks/bundle-fdEQfX2s.js';
import '../../ui/UserListItem.js';
import '../../chunks/bundle-CAEBoiEz.js';
import '../../ui/ImageRenderer.js';
import '../../chunks/bundle-Dl_v8XoN.js';
import '../../ui/MutedAvatarOverlay.js';
import '../../ui/Checkbox.js';
import '../../ui/UserProfile.js';
import '../../sendbirdSelectors.js';
import '../../chunks/bundle-BOykFtQ3.js';
import '../../chunks/bundle-CtQtfJlT.js';
import '../../chunks/bundle-DBhJIxHw.js';
import '../../chunks/bundle-BGCu7v8M.js';
import '../../chunks/bundle-DFni3Lhf.js';
import '@sendbird/chat/message';
import '@sendbird/uikit-tools';
import '../../chunks/bundle-CMi8r50C.js';

var kFormatter = function (num) {
    return Math.abs(num) > 999
        ? "".concat((Math.abs(num) / 1000).toFixed(1), "K")
        : num;
};
var UserPanel = function () {
    var stringSet = useLocalization().stringSet;
    var _a = useState(false), showAccordion = _a[0], setShowAccordion = _a[1];
    var channel = useChannelSettings().state.channel;
    return (React__default.createElement("div", { className: 'sendbird-channel-settings__user-panel' },
        React__default.createElement("div", { className: [
                'sendbird-channel-settings__panel-item',
                'sendbird-channel-settings__members',
            ].join(' '), role: "switch", "aria-checked": showAccordion, onKeyDown: function () { return setShowAccordion(!showAccordion); }, onClick: function () { return setShowAccordion(!showAccordion); }, tabIndex: 0 },
            React__default.createElement(Icon, { className: "sendbird-channel-settings__panel-icon-left", type: IconTypes.MEMBERS, fillColor: IconColors.PRIMARY, height: "24px", width: "24px" }),
            React__default.createElement(Label, { type: LabelTypography.SUBTITLE_1, color: LabelColors.ONBACKGROUND_1 },
                stringSet.CHANNEL_SETTING__MEMBERS__TITLE,
                React__default.createElement(Badge, { className: 'sendbird-channel-settings__badge', count: channel ? kFormatter(channel === null || channel === void 0 ? void 0 : channel.memberCount) : '' })),
            React__default.createElement(Icon, { className: [
                    'sendbird-channel-settings__panel-icon-right',
                    'sendbird-channel-settings__panel-icon--chevron',
                    (showAccordion ? 'sendbird-channel-settings__panel-icon--open' : ''),
                ].join(' '), type: IconTypes.CHEVRON_RIGHT, height: "24px", width: "24px" })),
        showAccordion && (React__default.createElement(MemberList, null))));
};

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