This repository has been archived by the owner on Aug 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathindex-3e543129.js
47 lines (45 loc) · 1.75 KB
/
index-3e543129.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import React__default, { useMemo } from 'react';
import { I as Icon, c as IconTypes, d as IconColors, A as Avatar } from './index-4456ba1e.js';
import { u as useDefaultAvatar, d as getChannelAvatarSource } from './utils-eb6e2fbe.js';
function ChannelAvatar(_a) {
var channel = _a.channel,
userId = _a.userId,
theme = _a.theme,
_b = _a.width,
width = _b === void 0 ? 56 : _b,
_c = _a.height,
height = _c === void 0 ? 56 : _c;
var isBroadcast = channel.isBroadcast;
var memoizedAvatar = useMemo(function () {
return isBroadcast ? useDefaultAvatar(channel) ? /*#__PURE__*/React__default.createElement("div", {
className: "sendbird-chat-header--default-avatar",
style: {
width: width,
height: height,
display: 'flex',
justifyContent: 'center',
alignItems: 'center'
}
}, /*#__PURE__*/React__default.createElement(Icon, {
type: IconTypes.BROADCAST,
fillColor: IconColors.CONTENT,
width: width * 0.575,
height: height * 0.575
})) : /*#__PURE__*/React__default.createElement(Avatar, {
className: "sendbird-chat-header--avatar--broadcast-channel",
src: getChannelAvatarSource(channel, userId),
width: width,
height: height,
alt: channel.name
}) : /*#__PURE__*/React__default.createElement(Avatar, {
className: "sendbird-chat-header--avatar--group-channel",
src: getChannelAvatarSource(channel, userId),
width: width + "px",
height: height + "px",
alt: channel.name
});
}, [channel.members, channel.coverUrl, theme]);
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, memoizedAvatar);
}
export { ChannelAvatar as C };
//# sourceMappingURL=index-3e543129.js.map