@tencentcloud/chat-uikit-react 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,13 @@
1
- import { useMemo as s } from "react";
1
+ import { useMemo as m } from "react";
2
2
  import { TUIChatEngine as i } from "@tencentcloud/chat-uikit-engine";
3
- import { E as p } from "../ChatSetting-BtQwjHr0.js";
3
+ import { E as C } from "../ChatSetting-LYkP2NWu.js";
4
4
  import "@tencentcloud/uikit-base-component-react";
5
5
  import "@tencentcloud/tui-core";
6
6
  import "react/jsx-runtime";
7
7
  import "@tencentcloud/chat";
8
- import { defaultUserAvatar as C, DEFAULT_GROUP_COMMON_AVATAR as E } from "../constant/avatar.js";
9
- import { useUIManagerState as T } from "./UIManagerState.js";
10
- function G() {
11
- const { userStatusMap: u } = T(), { activeConversation: t } = p(), n = t ? t.type === i.TYPES.CONV_SYSTEM : void 0, a = s(() => {
8
+ import { useUIManagerState as O } from "./UIManagerState.js";
9
+ function d() {
10
+ const { userStatusMap: u } = O(), { activeConversation: t } = C(), n = t ? t.type === i.TYPES.CONV_SYSTEM : void 0, s = m(() => {
12
11
  if (!t)
13
12
  return;
14
13
  if (n)
@@ -16,33 +15,32 @@ function G() {
16
15
  const {
17
16
  type: e,
18
17
  userProfile: r,
19
- remark: m,
18
+ remark: p,
20
19
  groupProfile: o
21
20
  } = t;
22
- return e === i.TYPES.CONV_C2C ? m || (r == null ? void 0 : r.nick) || (r == null ? void 0 : r.userID) || "" : e === i.TYPES.CONV_GROUP && ((o == null ? void 0 : o.name) || (o == null ? void 0 : o.groupID)) || "";
23
- }, [t, n]), O = s(() => {
21
+ return e === i.TYPES.CONV_C2C ? p || (r == null ? void 0 : r.nick) || (r == null ? void 0 : r.userID) || "" : e === i.TYPES.CONV_GROUP && ((o == null ? void 0 : o.name) || (o == null ? void 0 : o.groupID)) || "";
22
+ }, [t, n]), a = m(() => {
24
23
  if (!t || n)
25
- return;
24
+ return "";
26
25
  const {
27
26
  type: e,
28
- userProfile: r,
29
- groupProfile: m
27
+ userProfile: r
30
28
  } = t;
31
- return e === i.TYPES.CONV_C2C ? (r == null ? void 0 : r.avatar) || C : e === i.TYPES.CONV_GROUP ? (m == null ? void 0 : m.avatar) || E : "";
32
- }, [t, n]), f = s(() => {
29
+ return e === i.TYPES.CONV_C2C ? r == null ? void 0 : r.avatar : e === i.TYPES.CONV_GROUP ? t.getAvatar() : "";
30
+ }, [t, n]), S = m(() => {
33
31
  var e;
34
32
  if (t && !n && t.type !== i.TYPES.CONV_GROUP)
35
33
  return u == null ? void 0 : u[(e = t == null ? void 0 : t.userProfile) == null ? void 0 : e.userID];
36
- }, [t, u, n]), S = s(() => (t == null ? void 0 : t.type) === i.TYPES.CONV_GROUP, [t]);
34
+ }, [t, u, n]), f = m(() => (t == null ? void 0 : t.type) === i.TYPES.CONV_GROUP, [t]);
37
35
  return {
38
- title: a,
39
- avatar: O,
40
- isGroup: S,
36
+ title: s,
37
+ avatar: a,
38
+ isGroup: f,
41
39
  system: n,
42
40
  conversation: t,
43
- userStatus: f
41
+ userStatus: S
44
42
  };
45
43
  }
46
44
  export {
47
- G as useChatHeaderState
45
+ d as useChatHeaderState
48
46
  };