@droppii-org/chat-sdk 0.1.55 → 0.1.57
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.
- package/dist/components/biz-inbox/BizThreadAvatar.d.ts +3 -3
- package/dist/components/biz-inbox/BizThreadAvatar.d.ts.map +1 -1
- package/dist/components/biz-inbox/BizThreadAvatar.js +5 -5
- package/dist/components/biz-inbox/BizThreadCard.d.ts +3 -3
- package/dist/components/biz-inbox/BizThreadCard.d.ts.map +1 -1
- package/dist/components/biz-inbox/BizThreadCard.js +7 -8
- package/dist/components/biz-inbox/BizThreadList.d.ts +3 -3
- package/dist/components/biz-inbox/BizThreadList.d.ts.map +1 -1
- package/dist/components/biz-inbox/BizThreadList.js +4 -8
- package/dist/components/biz-inbox/BizThreadTitle.d.ts +3 -3
- package/dist/components/biz-inbox/BizThreadTitle.d.ts.map +1 -1
- package/dist/components/biz-inbox/BizThreadTitle.js +5 -5
- package/dist/components/biz-thread-detail/BizMessageList.d.ts.map +1 -1
- package/dist/components/biz-thread-detail/BizMessageList.js +4 -5
- package/dist/components/biz-thread-detail/BizThreadDetailHeader.d.ts +2 -2
- package/dist/components/biz-thread-detail/BizThreadDetailHeader.d.ts.map +1 -1
- package/dist/components/biz-thread-detail/BizThreadDetailHeader.js +7 -5
- package/dist/components/biz-thread-detail/BizThreadDetailInput.d.ts.map +1 -1
- package/dist/components/biz-thread-detail/BizThreadDetailInput.js +8 -13
- package/dist/components/biz-thread-detail/bot/BotButtonMessage.d.ts +1 -1
- package/dist/components/biz-thread-detail/bot/BotButtonMessage.d.ts.map +1 -1
- package/dist/components/conversation-detail/ConversationDetailHeader.d.ts +8 -0
- package/dist/components/conversation-detail/ConversationDetailHeader.d.ts.map +1 -0
- package/dist/components/conversation-detail/ConversationDetailHeader.js +18 -0
- package/dist/components/conversation-detail/ConversationDetailInput.d.ts +8 -0
- package/dist/components/conversation-detail/ConversationDetailInput.d.ts.map +1 -0
- package/dist/components/conversation-detail/ConversationDetailInput.js +258 -0
- package/dist/components/conversation-detail/ConversationMessageList.d.ts +7 -0
- package/dist/components/conversation-detail/ConversationMessageList.d.ts.map +1 -0
- package/dist/components/conversation-detail/ConversationMessageList.js +42 -0
- package/dist/components/conversation-detail/ConversationMoreOptionItem.d.ts +8 -0
- package/dist/components/conversation-detail/ConversationMoreOptionItem.d.ts.map +1 -0
- package/dist/components/conversation-detail/ConversationMoreOptionItem.js +19 -0
- package/dist/components/conversation-detail/ConversationMoreOptionPanel.d.ts +10 -0
- package/dist/components/conversation-detail/ConversationMoreOptionPanel.d.ts.map +1 -0
- package/dist/components/conversation-detail/ConversationMoreOptionPanel.js +20 -0
- package/dist/components/conversation-detail/bot/BotButtonMessage.d.ts +10 -0
- package/dist/components/conversation-detail/bot/BotButtonMessage.d.ts.map +1 -0
- package/dist/components/conversation-detail/bot/BotButtonMessage.js +30 -0
- package/dist/components/conversation-detail/bot/BotStartButton.d.ts +8 -0
- package/dist/components/conversation-detail/bot/BotStartButton.d.ts.map +1 -0
- package/dist/components/conversation-detail/bot/BotStartButton.js +11 -0
- package/dist/components/conversation-detail/bot/BotSuggest.d.ts +7 -0
- package/dist/components/conversation-detail/bot/BotSuggest.d.ts.map +1 -0
- package/dist/components/conversation-detail/bot/BotSuggest.js +11 -0
- package/dist/components/conversation-detail/bot/index.d.ts +7 -0
- package/dist/components/conversation-detail/bot/index.d.ts.map +1 -0
- package/dist/components/conversation-detail/bot/index.js +3 -0
- package/dist/components/conversation-detail/index.d.ts +10 -0
- package/dist/components/conversation-detail/index.d.ts.map +1 -0
- package/dist/components/conversation-detail/index.js +5 -0
- package/dist/components/conversation-inbox/ConversationInboxHeader.d.ts +3 -0
- package/dist/components/conversation-inbox/ConversationInboxHeader.d.ts.map +1 -0
- package/dist/components/conversation-inbox/ConversationInboxHeader.js +8 -0
- package/dist/components/conversation-inbox/ConversationInboxItem.d.ts +8 -0
- package/dist/components/conversation-inbox/ConversationInboxItem.d.ts.map +1 -0
- package/dist/components/conversation-inbox/ConversationInboxItem.js +30 -0
- package/dist/components/conversation-inbox/ConversationInboxList.d.ts +12 -0
- package/dist/components/conversation-inbox/ConversationInboxList.d.ts.map +1 -0
- package/dist/components/conversation-inbox/ConversationInboxList.js +36 -0
- package/dist/components/conversation-inbox/ConversationInboxTitle.d.ts +9 -0
- package/dist/components/conversation-inbox/ConversationInboxTitle.d.ts.map +1 -0
- package/dist/components/conversation-inbox/ConversationInboxTitle.js +7 -0
- package/dist/components/conversation-inbox/ConversationPeerAvatar.d.ts +10 -0
- package/dist/components/conversation-inbox/ConversationPeerAvatar.d.ts.map +1 -0
- package/dist/components/conversation-inbox/ConversationPeerAvatar.js +10 -0
- package/dist/components/conversation-inbox/index.d.ts +10 -0
- package/dist/components/conversation-inbox/index.d.ts.map +1 -0
- package/dist/components/conversation-inbox/index.js +5 -0
- package/dist/components/message/footer/LinkInputPreview.js +1 -1
- package/dist/components/message/item/ImageMessage.js +1 -1
- package/dist/components/message/item/LinkCard.js +1 -1
- package/dist/components/message/item/LinkText.js +1 -1
- package/dist/components/message/item/VideoMessage.js +1 -1
- package/dist/components/message/item/index.d.ts +2 -1
- package/dist/components/message/item/index.d.ts.map +1 -1
- package/dist/components/message/item/index.js +51 -38
- package/dist/components/message/item/mediaSize.d.ts.map +1 -1
- package/dist/components/message/item/mediaSize.js +8 -8
- package/dist/components/message/toolbox/MessageToolboxMenu.d.ts +5 -0
- package/dist/components/message/toolbox/MessageToolboxMenu.d.ts.map +1 -0
- package/dist/components/message/toolbox/MessageToolboxMenu.js +10 -0
- package/dist/components/message/toolbox/getCopyableMessageText.d.ts +4 -0
- package/dist/components/message/toolbox/getCopyableMessageText.d.ts.map +1 -0
- package/dist/components/message/toolbox/getCopyableMessageText.js +28 -0
- package/dist/components/message/toolbox/index.d.ts +5 -0
- package/dist/components/message/toolbox/index.d.ts.map +1 -0
- package/dist/components/message/toolbox/index.js +4 -0
- package/dist/components/message/toolbox/types.d.ts +15 -0
- package/dist/components/message/toolbox/types.d.ts.map +1 -0
- package/dist/components/message/toolbox/types.js +6 -0
- package/dist/components/message/toolbox/useMessageToolboxVisibility.d.ts +9 -0
- package/dist/components/message/toolbox/useMessageToolboxVisibility.d.ts.map +1 -0
- package/dist/components/message/toolbox/useMessageToolboxVisibility.js +15 -0
- package/dist/constants/moreOption.d.ts +9 -0
- package/dist/constants/moreOption.d.ts.map +1 -0
- package/dist/constants/moreOption.js +37 -0
- package/dist/hooks/conversation/useActiveConversation.d.ts +3 -0
- package/dist/hooks/conversation/useActiveConversation.d.ts.map +1 -0
- package/dist/hooks/conversation/useActiveConversation.js +31 -0
- package/dist/hooks/conversation/useBotConversationDetail.d.ts +3 -0
- package/dist/hooks/conversation/useBotConversationDetail.d.ts.map +1 -0
- package/dist/hooks/conversation/useBotConversationDetail.js +18 -0
- package/dist/hooks/conversation/useBotFlow.d.ts +18 -0
- package/dist/hooks/conversation/useBotFlow.d.ts.map +1 -0
- package/dist/hooks/conversation/useBotFlow.js +150 -0
- package/dist/hooks/conversation/useConversationList.d.ts +15 -0
- package/dist/hooks/conversation/useConversationList.d.ts.map +1 -0
- package/dist/hooks/conversation/useConversationList.js +70 -0
- package/dist/hooks/conversation/useCreateConversation.d.ts +8 -0
- package/dist/hooks/conversation/useCreateConversation.d.ts.map +1 -0
- package/dist/hooks/conversation/useCreateConversation.js +15 -0
- package/dist/hooks/conversation/useResetBotFlow.d.ts +3 -0
- package/dist/hooks/conversation/useResetBotFlow.d.ts.map +1 -0
- package/dist/hooks/conversation/useResetBotFlow.js +14 -0
- package/dist/hooks/conversation/useRunBotFlow.d.ts +7 -0
- package/dist/hooks/conversation/useRunBotFlow.d.ts.map +1 -0
- package/dist/hooks/conversation/useRunBotFlow.js +14 -0
- package/dist/hooks/global/useGlobalEvent.d.ts.map +1 -1
- package/dist/hooks/global/useGlobalEvent.js +15 -7
- package/dist/hooks/message/useSendMessage.d.ts +1 -1
- package/dist/hooks/message/useSendMessage.d.ts.map +1 -1
- package/dist/hooks/user/useAuth.js +2 -2
- package/dist/index.d.ts +12 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -6
- package/dist/locales/i18n.js +3 -3
- package/dist/locales/i18n.ts +3 -3
- package/dist/locales/vi/biz-inbox.json +39 -39
- package/dist/locales/vi/common.json +3 -0
- package/dist/locales/vi/conversation-inbox.json +39 -0
- package/dist/screens/biz-message/index.d.ts +3 -4
- package/dist/screens/biz-message/index.d.ts.map +1 -1
- package/dist/screens/biz-message/index.js +5 -9
- package/dist/screens/biz-thread-detail/index.js +6 -6
- package/dist/screens/conversation-detail/index.d.ts +9 -0
- package/dist/screens/conversation-detail/index.d.ts.map +1 -0
- package/dist/screens/conversation-detail/index.js +53 -0
- package/dist/screens/conversation-inbox/index.d.ts +8 -0
- package/dist/screens/conversation-inbox/index.d.ts.map +1 -0
- package/dist/screens/conversation-inbox/index.js +30 -0
- package/dist/services/query.d.ts +0 -1
- package/dist/services/query.d.ts.map +1 -1
- package/dist/services/query.js +0 -1
- package/dist/services/routes.d.ts +0 -1
- package/dist/services/routes.d.ts.map +1 -1
- package/dist/services/routes.js +0 -1
- package/dist/store/conversation.d.ts.map +1 -1
- package/dist/store/conversation.js +14 -5
- package/dist/store/messageDraft.d.ts +9 -0
- package/dist/store/messageDraft.d.ts.map +1 -0
- package/dist/store/messageDraft.js +35 -0
- package/dist/store/type.d.ts +6 -1
- package/dist/store/type.d.ts.map +1 -1
- package/dist/styles/global.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/conversation.d.ts +116 -0
- package/dist/types/conversation.d.ts.map +1 -0
- package/dist/types/conversation.js +33 -0
- package/dist/utils/common.d.ts +1 -1
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/common.js +5 -3
- package/dist/utils/conversation.d.ts +12 -0
- package/dist/utils/conversation.d.ts.map +1 -0
- package/dist/utils/conversation.js +53 -0
- package/dist/utils/events.d.ts +1 -1
- package/dist/utils/events.d.ts.map +1 -1
- package/dist/utils/fileValidation.d.ts +2 -1
- package/dist/utils/fileValidation.d.ts.map +1 -1
- package/dist/utils/fileValidation.js +10 -1
- package/dist/utils/imCommon.d.ts +1 -0
- package/dist/utils/imCommon.d.ts.map +1 -1
- package/package.json +126 -127
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChatCategory, PeerType } from "../../types/conversation";
|
|
2
2
|
export interface BizThreadAvatarProps {
|
|
3
|
-
peerType:
|
|
4
|
-
chatCategory:
|
|
3
|
+
peerType: PeerType;
|
|
4
|
+
chatCategory: ChatCategory;
|
|
5
5
|
displayName: string;
|
|
6
6
|
avatarUrl: string | null;
|
|
7
7
|
badgeLabel: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BizThreadAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/biz-inbox/BizThreadAvatar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"BizThreadAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/biz-inbox/BizThreadAvatar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAG9D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,eAAe,GAAI,iEAMtB,oBAAoB,4CAmCtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { Icon } from "../../components/icon";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { ChatCategory, PeerType } from "../../types/conversation";
|
|
6
|
+
import { resolvePeerBadgeColor } from "../../utils/conversation";
|
|
7
7
|
const BizThreadAvatar = ({ peerType, chatCategory, displayName, avatarUrl, badgeLabel, }) => {
|
|
8
|
-
const badge = badgeLabel ? (_jsx("span", { className: clsx("absolute -bottom-px -right-px flex h-[17px] items-center justify-center gap-2 rounded-md border border-white px-1 text-[10px] font-semibold leading-3 text-white shadow-badge-inset",
|
|
9
|
-
return (_jsxs("div", { className: "relative h-12 w-12 shrink-0", children: [avatarUrl ? (_jsx("img", { src: avatarUrl, alt: displayName, className: "h-12 w-12 rounded-full object-cover" })) : (_jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-chat-avatar text-white", children: chatCategory ===
|
|
10
|
-
peerType ===
|
|
8
|
+
const badge = badgeLabel ? (_jsx("span", { className: clsx("absolute -bottom-px -right-px flex h-[17px] items-center justify-center gap-2 rounded-md border border-white px-1 text-[10px] font-semibold leading-3 text-white shadow-badge-inset", resolvePeerBadgeColor(peerType)), children: badgeLabel })) : null;
|
|
9
|
+
return (_jsxs("div", { className: "relative h-12 w-12 shrink-0", children: [avatarUrl ? (_jsx("img", { src: avatarUrl, alt: displayName, className: "h-12 w-12 rounded-full object-cover" })) : (_jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-chat-avatar text-white", children: chatCategory === ChatCategory.GROUP ||
|
|
10
|
+
peerType === PeerType.GROUP ? (_jsx(Icon, { icon: "user-two-b", size: 20 })) : peerType === PeerType.BOT ? (_jsx(Icon, { icon: "droppii-o-1", size: 20 })) : (_jsx(Icon, { icon: "user-o", size: 20 })) })), badge] }));
|
|
11
11
|
};
|
|
12
12
|
export default BizThreadAvatar;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ConversationListItem } from "../../types/conversation";
|
|
2
2
|
export interface BizThreadCardProps {
|
|
3
|
-
item:
|
|
4
|
-
onClick: (item:
|
|
3
|
+
item: ConversationListItem;
|
|
4
|
+
onClick: (item: ConversationListItem) => void;
|
|
5
5
|
}
|
|
6
6
|
declare const BizThreadCard: ({ item, onClick }: BizThreadCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default BizThreadCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BizThreadCard.d.ts","sourceRoot":"","sources":["../../../src/components/biz-inbox/BizThreadCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BizThreadCard.d.ts","sourceRoot":"","sources":["../../../src/components/biz-inbox/BizThreadCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAYjE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,OAAO,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAC/C;AAQD,QAAA,MAAM,aAAa,GAAI,mBAAmB,kBAAkB,4CA4C3D,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -3,9 +3,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import dayjs from "dayjs";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
5
|
import useAuthStore from "../../store/auth";
|
|
6
|
-
import { formatTimestamp } from "../../utils/common";
|
|
7
|
-
import {
|
|
8
|
-
import { resolveBizAvatarUrl, resolveBizBadgeLabel, resolveBizDisplayName, } from "../../utils/bizConversation";
|
|
6
|
+
import { formatTimestamp, parseLatestMessage } from "../../utils/common";
|
|
7
|
+
import { resolveConversationAvatarUrl, resolvePeerBadgeLabel, resolveConversationDisplayName, } from "../../utils/conversation";
|
|
9
8
|
import ThreadCard from "../../components/conversation/ThreadCard";
|
|
10
9
|
import BizThreadAvatar from "./BizThreadAvatar";
|
|
11
10
|
import BizThreadTitle from "./BizThreadTitle";
|
|
@@ -20,12 +19,12 @@ const BizThreadCard = ({ item, onClick }) => {
|
|
|
20
19
|
const { t } = useTranslation("biz-inbox");
|
|
21
20
|
const { t: tCommon } = useTranslation("common");
|
|
22
21
|
const currentUserId = useAuthStore((state) => state.userID);
|
|
23
|
-
const displayName =
|
|
24
|
-
const avatarUrl =
|
|
25
|
-
const badgeLabel =
|
|
26
|
-
const latestMessagePreview =
|
|
22
|
+
const displayName = resolveConversationDisplayName(item, t);
|
|
23
|
+
const avatarUrl = resolveConversationAvatarUrl(item);
|
|
24
|
+
const badgeLabel = resolvePeerBadgeLabel(item.peerType, t);
|
|
25
|
+
const latestMessagePreview = parseLatestMessage(item.latestMsg, currentUserId, tCommon);
|
|
27
26
|
const latestMessageTime = formatLatestMessageTime(item.latestMsgSendTime || null);
|
|
28
27
|
const unreadCount = (_a = item.unreadCount) !== null && _a !== void 0 ? _a : 0;
|
|
29
|
-
return (_jsx(ThreadCard, { testId: "biz-inbox-thread-card", onClick: () => onClick(item), unreadCount: unreadCount, time: latestMessageTime, preview: latestMessagePreview, avatar: _jsx(BizThreadAvatar, { peerType: item.
|
|
28
|
+
return (_jsx(ThreadCard, { testId: "biz-inbox-thread-card", onClick: () => onClick(item), unreadCount: unreadCount, time: latestMessageTime, preview: latestMessagePreview, avatar: _jsx(BizThreadAvatar, { peerType: item.peerType, chatCategory: item.chatCategory, displayName: displayName, avatarUrl: avatarUrl, badgeLabel: badgeLabel }), title: _jsx(BizThreadTitle, { peerType: item.peerType, chatCategory: item.chatCategory, displayName: displayName, hasUnread: unreadCount > 0 }) }));
|
|
30
29
|
};
|
|
31
30
|
export default BizThreadCard;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ConversationListItem } from "../../types/conversation";
|
|
2
2
|
export interface BizThreadListProps {
|
|
3
|
-
items:
|
|
3
|
+
items: ConversationListItem[];
|
|
4
4
|
isLoading: boolean;
|
|
5
5
|
isFetchingNextPage: boolean;
|
|
6
6
|
hasNextPage: boolean;
|
|
7
7
|
onLoadMore: () => void;
|
|
8
|
-
onSelectThread?: (item:
|
|
8
|
+
onSelectThread?: (item: ConversationListItem) => void;
|
|
9
9
|
}
|
|
10
10
|
declare const BizThreadList: ({ items, isLoading, isFetchingNextPage, hasNextPage, onLoadMore, onSelectThread, }: BizThreadListProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export default BizThreadList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BizThreadList.d.ts","sourceRoot":"","sources":["../../../src/components/biz-inbox/BizThreadList.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BizThreadList.d.ts","sourceRoot":"","sources":["../../../src/components/biz-inbox/BizThreadList.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAKjE,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,oBAAoB,EAAE,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;CACvD;AAYD,QAAA,MAAM,aAAa,GAAI,oFAOpB,kBAAkB,4CA8EpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -4,9 +4,7 @@ import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
5
|
import { Empty, Spin } from "antd";
|
|
6
6
|
import InfiniteScroll from "react-infinite-scroll-component";
|
|
7
|
-
import useBizConversationStore from "../../store/bizConversation";
|
|
8
7
|
import useConversationStore from "../../store/conversation";
|
|
9
|
-
import { buildBizSdkConversation } from "../../utils/bizConversation";
|
|
10
8
|
import { Icon } from "../../components/icon";
|
|
11
9
|
import BizThreadCard from "./BizThreadCard";
|
|
12
10
|
const FooterSkeleton = () => (_jsxs("div", { className: "flex items-center gap-3 p-3", children: [_jsx("div", { className: "h-10 w-10 animate-pulse rounded-full bg-neutral-200" }), _jsxs("div", { className: "flex flex-1 flex-col gap-2", children: [_jsx("div", { className: "h-3 w-1/2 animate-pulse rounded bg-neutral-200" }), _jsx("div", { className: "h-2.5 w-1/3 animate-pulse rounded bg-neutral-200" })] })] }));
|
|
@@ -15,16 +13,14 @@ const BizThreadList = ({ items, isLoading, isFetchingNextPage, hasNextPage, onLo
|
|
|
15
13
|
const router = useRouter();
|
|
16
14
|
const pathname = usePathname();
|
|
17
15
|
const searchParams = useSearchParams();
|
|
18
|
-
const selectConversation = useBizConversationStore((state) => state.selectConversation);
|
|
19
16
|
const setConversationData = useConversationStore((state) => state.setConversationData);
|
|
20
17
|
const setSelectedConversationId = useConversationStore((state) => state.setSelectedConversationId);
|
|
21
18
|
const handleSelectThread = (item) => {
|
|
22
19
|
const newSearchParams = new URLSearchParams(searchParams);
|
|
23
|
-
newSearchParams.set("threadId", item.
|
|
20
|
+
newSearchParams.set("threadId", item.conversationID);
|
|
24
21
|
router.push(`${pathname}?${newSearchParams.toString()}`);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
setConversationData(buildBizSdkConversation(item));
|
|
22
|
+
setSelectedConversationId(item.conversationID);
|
|
23
|
+
setConversationData(item);
|
|
28
24
|
onSelectThread === null || onSelectThread === void 0 ? void 0 : onSelectThread(item);
|
|
29
25
|
};
|
|
30
26
|
const handleEndReached = () => {
|
|
@@ -35,6 +31,6 @@ const BizThreadList = ({ items, isLoading, isFetchingNextPage, hasNextPage, onLo
|
|
|
35
31
|
if (isLoading) {
|
|
36
32
|
return (_jsx("div", { "data-testid": "biz-inbox-thread-list", className: "flex flex-1 items-center justify-center py-12", children: _jsx(Spin, {}) }));
|
|
37
33
|
}
|
|
38
|
-
return (_jsx("div", { id: "scrollableBizThreadsDiv", "data-testid": "biz-inbox-thread-list", className: "min-h-0 w-full flex-1 overflow-auto", children: _jsx(InfiniteScroll, { dataLength: items.length, next: handleEndReached, hasMore: hasNextPage, loader: isFetchingNextPage ? _jsx(FooterSkeleton, {}) : null, scrollableTarget: "scrollableBizThreadsDiv", children: items.length === 0 ? (_jsx("div", { className: "flex items-center justify-center py-12", children: _jsx(Empty, { image: _jsx(Icon, { icon: "chat-square-b", size: 80, className: "text-gray-300" }), description: t("empty.no_conversations") }) })) : (items.map((item) => (_jsx(BizThreadCard, { item: item, onClick: handleSelectThread }, item.
|
|
34
|
+
return (_jsx("div", { id: "scrollableBizThreadsDiv", "data-testid": "biz-inbox-thread-list", className: "min-h-0 w-full flex-1 overflow-auto", children: _jsx(InfiniteScroll, { dataLength: items.length, next: handleEndReached, hasMore: hasNextPage, loader: isFetchingNextPage ? _jsx(FooterSkeleton, {}) : null, scrollableTarget: "scrollableBizThreadsDiv", children: items.length === 0 ? (_jsx("div", { className: "flex items-center justify-center py-12", children: _jsx(Empty, { image: _jsx(Icon, { icon: "chat-square-b", size: 80, className: "text-gray-300" }), description: t("empty.no_conversations") }) })) : (items.map((item) => (_jsx(BizThreadCard, { item: item, onClick: handleSelectThread }, item.conversationID)))) }) }));
|
|
39
35
|
};
|
|
40
36
|
export default BizThreadList;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChatCategory, PeerType } from "../../types/conversation";
|
|
2
2
|
export interface BizThreadTitleProps {
|
|
3
|
-
peerType:
|
|
4
|
-
chatCategory:
|
|
3
|
+
peerType: PeerType;
|
|
4
|
+
chatCategory: ChatCategory;
|
|
5
5
|
displayName: string;
|
|
6
6
|
hasUnread?: boolean;
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BizThreadTitle.d.ts","sourceRoot":"","sources":["../../../src/components/biz-inbox/BizThreadTitle.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"BizThreadTitle.d.ts","sourceRoot":"","sources":["../../../src/components/biz-inbox/BizThreadTitle.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,cAAc,GAAI,qDAKrB,mBAAmB,4CA2BrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { Icon } from "../../components/icon";
|
|
5
|
-
import {
|
|
6
|
-
const BizThreadTitle = ({ peerType, chatCategory, displayName, hasUnread = false, }) => (_jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [(chatCategory ===
|
|
7
|
-
peerType ===
|
|
8
|
-
chatCategory ===
|
|
9
|
-
chatCategory ===
|
|
5
|
+
import { ChatCategory, PeerType } from "../../types/conversation";
|
|
6
|
+
const BizThreadTitle = ({ peerType, chatCategory, displayName, hasUnread = false, }) => (_jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [(chatCategory === ChatCategory.GROUP ||
|
|
7
|
+
peerType === PeerType.GROUP) && (_jsx(Icon, { icon: "user-two-b", size: 12, className: "shrink-0 text-black" })), peerType === PeerType.BOT &&
|
|
8
|
+
chatCategory === ChatCategory.BIZ_BOT_PDP && (_jsx("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center gap-0.5 rounded-full border border-white bg-gradient-pr-light px-1 py-0.5 text-white", children: _jsx(Icon, { icon: "shield-done-b", size: 8 }) })), peerType === PeerType.BOT &&
|
|
9
|
+
chatCategory === ChatCategory.BIZ_BOT_CRM && (_jsx("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-black text-white", children: _jsx(Icon, { icon: "droppii-o-1", size: 8 }) })), _jsx("span", { className: clsx("min-w-0 truncate text-[16px] leading-[160%] text-black [font-feature-settings:'liga'_off,'clig'_off]", hasUnread ? "font-bold tracking-[0.16px]" : "font-[510]"), children: displayName })] }));
|
|
10
10
|
export default BizThreadTitle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BizMessageList.d.ts","sourceRoot":"","sources":["../../../src/components/biz-thread-detail/BizMessageList.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BizMessageList.d.ts","sourceRoot":"","sources":["../../../src/components/biz-thread-detail/BizMessageList.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAalD,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED,QAAA,MAAM,cAAc,GAAI,gBAAgB,mBAAmB,4CA0E1D,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -7,20 +7,19 @@ import { useChatContext } from "../../context/ChatContext";
|
|
|
7
7
|
import MessageInfiniteScroll from "../../components/message/MessageInfiniteScroll";
|
|
8
8
|
import { useMessage } from "../../hooks/message/useMessage";
|
|
9
9
|
import { useMessageListScroll } from "../../hooks/message/useMessageListScroll";
|
|
10
|
-
import useBizConversationStore from "../../store/bizConversation";
|
|
11
10
|
import useConversationStore from "../../store/conversation";
|
|
12
11
|
import useAuthStore from "../../store/auth";
|
|
13
|
-
import {
|
|
12
|
+
import { isGroupChat as resolveIsGroupChat } from "../../utils/conversation";
|
|
14
13
|
import emitter from "../../utils/events";
|
|
15
14
|
import MessageItem from "../../components/message/item";
|
|
16
15
|
const BizMessageList = ({ bottomSlot }) => {
|
|
17
16
|
const { t } = useTranslation("biz-inbox");
|
|
18
17
|
const { user } = useChatContext();
|
|
19
18
|
const authUserID = useAuthStore((state) => state.userID);
|
|
20
|
-
const conversation =
|
|
19
|
+
const conversation = useConversationStore((state) => state.conversationData);
|
|
21
20
|
const selectedConversationId = useConversationStore((state) => state.selectedConversationId);
|
|
22
|
-
const conversationId = selectedConversationId || (conversation === null || conversation === void 0 ? void 0 : conversation.
|
|
23
|
-
const isGroupChat = conversation ?
|
|
21
|
+
const conversationId = selectedConversationId || (conversation === null || conversation === void 0 ? void 0 : conversation.conversationID) || "";
|
|
22
|
+
const isGroupChat = conversation ? resolveIsGroupChat(conversation) : false;
|
|
24
23
|
const messageController = useMessage(conversationId);
|
|
25
24
|
const { scrollRef, loadMoreOldMessage, handleInfiniteScroll, scrollToBottomIfAtBottom, } = useMessageListScroll(Object.assign({ conversationId, userId: (user === null || user === void 0 ? void 0 : user.userID) || authUserID }, messageController));
|
|
26
25
|
const { loadState, moreOldLoading } = messageController;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ConversationItem } from "@openim/wasm-client-sdk";
|
|
2
2
|
export interface BizThreadDetailHeaderProps {
|
|
3
|
-
conversation:
|
|
3
|
+
conversation: ConversationItem;
|
|
4
4
|
onBack?: () => void;
|
|
5
5
|
}
|
|
6
6
|
declare const BizThreadDetailHeader: ({ conversation, onBack, }: BizThreadDetailHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BizThreadDetailHeader.d.ts","sourceRoot":"","sources":["../../../src/components/biz-thread-detail/BizThreadDetailHeader.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BizThreadDetailHeader.d.ts","sourceRoot":"","sources":["../../../src/components/biz-thread-detail/BizThreadDetailHeader.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAShE,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAqBD,QAAA,MAAM,qBAAqB,GAAI,2BAG5B,0BAA0B,4CA6C5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -4,14 +4,16 @@ import { useTranslation } from "react-i18next";
|
|
|
4
4
|
import { Icon } from "../../components/icon";
|
|
5
5
|
import BizThreadAvatar from "../../components/biz-inbox/BizThreadAvatar";
|
|
6
6
|
import BizThreadTitle from "../../components/biz-inbox/BizThreadTitle";
|
|
7
|
-
import {
|
|
7
|
+
import { resolveConversationAvatarUrl, resolveConversationChatCategory, resolveConversationDisplayName, resolvePeerBadgeLabel, } from "../../utils/conversation";
|
|
8
8
|
const HeaderIconButton = ({ icon, onClick, testId, }) => (_jsx("button", { type: "button", onClick: onClick, "data-testid": testId, className: "flex shrink-0 cursor-pointer items-center justify-center p-2 text-primary-400", children: _jsx(Icon, { icon: icon, size: 24 }) }));
|
|
9
9
|
const BizThreadDetailHeader = ({ conversation, onBack, }) => {
|
|
10
10
|
const { t } = useTranslation("biz-inbox");
|
|
11
|
-
const displayName =
|
|
12
|
-
const avatarUrl =
|
|
13
|
-
const
|
|
11
|
+
const displayName = resolveConversationDisplayName(conversation, t);
|
|
12
|
+
const avatarUrl = resolveConversationAvatarUrl(conversation);
|
|
13
|
+
const peerType = conversation.peerType;
|
|
14
|
+
const chatCategory = resolveConversationChatCategory(conversation);
|
|
15
|
+
const badgeLabel = resolvePeerBadgeLabel(peerType, t);
|
|
14
16
|
const subtitle = t("thread_detail.profile_hint");
|
|
15
|
-
return (_jsxs("div", { "data-testid": "biz-thread-detail-header", className: "flex w-full cursor-default items-center border-b border-gray-25 bg-white p-2 shadow-inset-gray-divider", children: [_jsx(HeaderIconButton, { icon: "arrow-left-o", onClick: onBack, testId: "biz-thread-detail-back" }), _jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2 px-1", "data-testid": "biz-thread-detail-profile", children: [_jsx(BizThreadAvatar, { peerType:
|
|
17
|
+
return (_jsxs("div", { "data-testid": "biz-thread-detail-header", className: "flex w-full cursor-default items-center border-b border-gray-25 bg-white p-2 shadow-inset-gray-divider", children: [_jsx(HeaderIconButton, { icon: "arrow-left-o", onClick: onBack, testId: "biz-thread-detail-back" }), _jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2 px-1", "data-testid": "biz-thread-detail-profile", children: [_jsx(BizThreadAvatar, { peerType: peerType, chatCategory: chatCategory, displayName: displayName, avatarUrl: avatarUrl, badgeLabel: badgeLabel }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx(BizThreadTitle, { peerType: peerType, chatCategory: chatCategory, displayName: displayName }), _jsx("p", { className: "truncate text-[10px] font-normal leading-[160%] tracking-[0.1px] text-gray-600 [font-feature-settings:'liga'_off,'clig'_off]", children: subtitle })] })] })] }));
|
|
16
18
|
};
|
|
17
19
|
export default BizThreadDetailHeader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BizThreadDetailInput.d.ts","sourceRoot":"","sources":["../../../src/components/biz-thread-detail/BizThreadDetailInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BizThreadDetailInput.d.ts","sourceRoot":"","sources":["../../../src/components/biz-thread-detail/BizThreadDetailInput.tsx"],"names":[],"mappings":"AA8BA,MAAM,WAAW,yBAAyB;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,QAAA,MAAM,oBAAoB,GAAI,gDAI3B,yBAAyB,4CAmY3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -7,10 +7,9 @@ import clsx from "clsx";
|
|
|
7
7
|
import { Icon } from "../../components/icon";
|
|
8
8
|
import { useSendMessage } from "../../hooks/message/useSendMessage";
|
|
9
9
|
import useAuthStore from "../../store/auth";
|
|
10
|
-
import useBizConversationStore from "../../store/bizConversation";
|
|
11
10
|
import useConversationStore from "../../store/conversation";
|
|
12
11
|
import useBizMessageDraftStore from "../../store/bizMessageDraft";
|
|
13
|
-
import {
|
|
12
|
+
import { resolveConversationAvatarUrl, resolveConversationDisplayName, } from "../../utils/conversation";
|
|
14
13
|
import { emit } from "../../utils/events";
|
|
15
14
|
import { extractLinkUrls } from "../../utils/link";
|
|
16
15
|
import { useFetchUrlMetadata } from "../../hooks/common/useFetchUrlMetadata";
|
|
@@ -23,25 +22,21 @@ const CONTAINER_MIN_HEIGHT = 48;
|
|
|
23
22
|
const BizThreadDetailInput = ({ placeholder, onSendMessage, onInputChange, }) => {
|
|
24
23
|
const { t } = useTranslation("biz-inbox");
|
|
25
24
|
const { t: tCommon } = useTranslation("common");
|
|
26
|
-
const bizConversation = useBizConversationStore((state) => state.conversationData);
|
|
27
25
|
const conversationData = useConversationStore((state) => state.conversationData);
|
|
28
26
|
const selectedConversationId = useConversationStore((state) => state.selectedConversationId);
|
|
29
|
-
const conversationId = selectedConversationId || (
|
|
27
|
+
const conversationId = selectedConversationId || (conversationData === null || conversationData === void 0 ? void 0 : conversationData.conversationID) || "";
|
|
30
28
|
const isConversationReady = !!conversationData && (!!conversationData.userID || !!conversationData.groupID);
|
|
31
29
|
const sendMessageOptions = useMemo(() => ({
|
|
32
30
|
scrollEvent: "BIZ_CHAT_SCROLL_TO_BOTTOM_IF_AT_BOTTOM",
|
|
33
31
|
resolveOfflinePushMeta: () => ({
|
|
34
|
-
title:
|
|
35
|
-
?
|
|
36
|
-
:
|
|
37
|
-
icon: (
|
|
38
|
-
(conversationData === null || conversationData === void 0 ? void 0 : conversationData.faceURL) ||
|
|
39
|
-
"",
|
|
40
|
-
conversationId: (bizConversation === null || bizConversation === void 0 ? void 0 : bizConversation.conversationId) ||
|
|
41
|
-
(conversationData === null || conversationData === void 0 ? void 0 : conversationData.conversationID) ||
|
|
32
|
+
title: conversationData
|
|
33
|
+
? resolveConversationDisplayName(conversationData, t)
|
|
34
|
+
: "Droppii Chat",
|
|
35
|
+
icon: (conversationData && resolveConversationAvatarUrl(conversationData)) ||
|
|
42
36
|
"",
|
|
37
|
+
conversationId: (conversationData === null || conversationData === void 0 ? void 0 : conversationData.conversationID) || "",
|
|
43
38
|
}),
|
|
44
|
-
}), [
|
|
39
|
+
}), [conversationData, t]);
|
|
45
40
|
const { sendMergeMessage } = useSendMessage(sendMessageOptions);
|
|
46
41
|
const userID = useAuthStore((state) => state.userID);
|
|
47
42
|
const setDraft = useBizMessageDraftStore((state) => state.setDraft);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BotButtonMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/biz-thread-detail/bot/BotButtonMessage.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"BotButtonMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/biz-thread-detail/bot/BotButtonMessage.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAI5D,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,QAAA,MAAM,gBAAgB,GAAI,6CAKvB,qBAAqB,mDA4EvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ConversationItem } from "@openim/wasm-client-sdk";
|
|
2
|
+
export interface ConversationDetailHeaderProps {
|
|
3
|
+
conversation: ConversationItem;
|
|
4
|
+
onBack?: () => void;
|
|
5
|
+
}
|
|
6
|
+
declare const ConversationDetailHeader: ({ conversation, onBack, }: ConversationDetailHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ConversationDetailHeader;
|
|
8
|
+
//# sourceMappingURL=ConversationDetailHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConversationDetailHeader.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-detail/ConversationDetailHeader.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAQhE,MAAM,WAAW,6BAA6B;IAC5C,YAAY,EAAE,gBAAgB,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAqBD,QAAA,MAAM,wBAAwB,GAAI,2BAG/B,6BAA6B,4CAyC/B,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import { Icon } from "../../components/icon";
|
|
5
|
+
import ConversationPeerAvatar from "../../components/conversation-inbox/ConversationPeerAvatar";
|
|
6
|
+
import ConversationInboxTitle from "../../components/conversation-inbox/ConversationInboxTitle";
|
|
7
|
+
import { resolveConversationAvatarUrl, resolveConversationDisplayName, resolvePeerBadgeLabel, } from "../../utils/conversation";
|
|
8
|
+
const HeaderIconButton = ({ icon, onClick, testId, }) => (_jsx("button", { type: "button", onClick: onClick, "data-testid": testId, className: "flex shrink-0 cursor-pointer items-center justify-center p-2 text-primary-400", children: _jsx(Icon, { icon: icon, size: 24 }) }));
|
|
9
|
+
const ConversationDetailHeader = ({ conversation, onBack, }) => {
|
|
10
|
+
const { t } = useTranslation("conversation-inbox");
|
|
11
|
+
const displayName = resolveConversationDisplayName(conversation, t);
|
|
12
|
+
const avatarUrl = resolveConversationAvatarUrl(conversation);
|
|
13
|
+
const peerType = conversation.peerType;
|
|
14
|
+
const badgeLabel = resolvePeerBadgeLabel(peerType, t);
|
|
15
|
+
const subtitle = t("thread_detail.profile_hint");
|
|
16
|
+
return (_jsxs("div", { "data-testid": "conversation-detail-header", className: "flex w-full cursor-default items-center border-b border-gray-25 bg-white p-2 shadow-inset-gray-divider", children: [_jsx(HeaderIconButton, { icon: "arrow-left-o", onClick: onBack, testId: "conversation-detail-back" }), _jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2 px-1", "data-testid": "conversation-detail-profile", children: [_jsx(ConversationPeerAvatar, { peerType: peerType, displayName: displayName, avatarUrl: avatarUrl, badgeLabel: badgeLabel }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx(ConversationInboxTitle, { peerType: peerType, displayName: displayName }), _jsx("p", { className: "truncate text-[10px] font-normal leading-[160%] tracking-[0.1px] text-gray-600 [font-feature-settings:'liga'_off,'clig'_off]", children: subtitle })] })] })] }));
|
|
17
|
+
};
|
|
18
|
+
export default ConversationDetailHeader;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ConversationDetailInputProps {
|
|
2
|
+
placeholder?: string;
|
|
3
|
+
onSendMessage?: (text: string) => void;
|
|
4
|
+
onInputChange?: (value: string) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const ConversationDetailInput: ({ placeholder, onSendMessage, onInputChange, }: ConversationDetailInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ConversationDetailInput;
|
|
8
|
+
//# sourceMappingURL=ConversationDetailInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConversationDetailInput.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-detail/ConversationDetailInput.tsx"],"names":[],"mappings":"AA8BA,MAAM,WAAW,4BAA4B;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,QAAA,MAAM,uBAAuB,GAAI,gDAI9B,4BAA4B,4CA2Y9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|