@daeryun/dr_components 1.2.18 → 1.2.19
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/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/Daeryuntalk/ChatButton.jsx +1 -1
- package/dist/components/Daeryuntalk/ChatButton.tsx +1 -1
- package/dist/components/Daeryuntalk/ChatWidget.d.ts +1 -0
- package/dist/components/Daeryuntalk/ChatWidget.jsx +114 -31
- package/dist/components/Daeryuntalk/ChatWidget.tsx +120 -37
- package/dist/components/Daeryuntalk/Viewer/TbPcViewer.tsx +0 -9
- package/dist/components/Daeryuntalk/index.jsx +17 -1
- package/dist/components/Daeryuntalk/index.tsx +26 -2
- package/dist/components/DaeryuntalkBackup/ChatButton.d.ts +11 -0
- package/dist/components/DaeryuntalkBackup/ChatButton.jsx +123 -0
- package/dist/components/DaeryuntalkBackup/ChatButton.tsx +157 -0
- package/dist/components/DaeryuntalkBackup/ChatConversation.d.ts +21 -0
- package/dist/components/DaeryuntalkBackup/ChatConversation.jsx +259 -0
- package/dist/components/DaeryuntalkBackup/ChatConversation.tsx +390 -0
- package/dist/components/DaeryuntalkBackup/ChatConversationItem/ChatConversationHeader.d.ts +16 -0
- package/dist/components/DaeryuntalkBackup/ChatConversationItem/ChatConversationHeader.jsx +50 -0
- package/dist/components/DaeryuntalkBackup/ChatConversationItem/ChatConversationHeader.tsx +108 -0
- package/dist/components/DaeryuntalkBackup/ChatHomeView.d.ts +14 -0
- package/dist/components/DaeryuntalkBackup/ChatHomeView.jsx +147 -0
- package/dist/components/DaeryuntalkBackup/ChatHomeView.tsx +262 -0
- package/dist/components/DaeryuntalkBackup/ChatInput.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatInput.jsx +64 -0
- package/dist/components/DaeryuntalkBackup/ChatInput.tsx +98 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/AgeCheckBox.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/AgeCheckBox.jsx +19 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/AgeCheckBox.tsx +27 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatFile.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatFile.jsx +165 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatFile.tsx +244 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatLoading.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatLoading.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatLoading.tsx +25 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatPrivacyAuth.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatPrivacyAuth.jsx +100 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatPrivacyAuth.tsx +135 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatWrapper.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatWrapper.jsx +14 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatWrapper.tsx +26 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/RichText.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/RichText.jsx +37 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/RichText.tsx +45 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TimeWrapper.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TimeWrapper.jsx +10 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TimeWrapper.tsx +21 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TypingComp.d.ts +3 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TypingComp.jsx +34 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TypingComp.tsx +43 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowAuthForm.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowAuthForm.jsx +20 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowAuthForm.tsx +32 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowClickData.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowClickData.jsx +21 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowClickData.tsx +37 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowImg.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowImg.jsx +178 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowImg.tsx +233 -0
- package/dist/components/DaeryuntalkBackup/ChatMessage.d.ts +20 -0
- package/dist/components/DaeryuntalkBackup/ChatMessage.jsx +198 -0
- package/dist/components/DaeryuntalkBackup/ChatMessage.tsx +295 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/FieldWorkObject.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/FieldWorkObject.jsx +39 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/FieldWorkObject.tsx +75 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectBack.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectBack.jsx +20 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectBack.tsx +39 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectButton.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectButton.jsx +138 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectButton.tsx +177 -0
- package/dist/components/DaeryuntalkBackup/ChatWidget.d.ts +13 -0
- package/dist/components/DaeryuntalkBackup/ChatWidget.jsx +154 -0
- package/dist/components/DaeryuntalkBackup/ChatWidget.tsx +221 -0
- package/dist/components/DaeryuntalkBackup/DaeryuntalkContext.d.ts +103 -0
- package/dist/components/DaeryuntalkBackup/DaeryuntalkContext.jsx +207 -0
- package/dist/components/DaeryuntalkBackup/DaeryuntalkContext.tsx +350 -0
- package/dist/components/DaeryuntalkBackup/DateSeparator.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/DateSeparator.jsx +14 -0
- package/dist/components/DaeryuntalkBackup/DateSeparator.tsx +24 -0
- package/dist/components/DaeryuntalkBackup/FixedErrorBox.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/FixedErrorBox.jsx +34 -0
- package/dist/components/DaeryuntalkBackup/FixedErrorBox.tsx +73 -0
- package/dist/components/DaeryuntalkBackup/History/AuthForm.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/History/AuthForm.jsx +157 -0
- package/dist/components/DaeryuntalkBackup/History/AuthForm.tsx +206 -0
- package/dist/components/DaeryuntalkBackup/HistoryView.d.ts +19 -0
- package/dist/components/DaeryuntalkBackup/HistoryView.jsx +94 -0
- package/dist/components/DaeryuntalkBackup/HistoryView.tsx +182 -0
- package/dist/components/DaeryuntalkBackup/HomeView.d.ts +12 -0
- package/dist/components/DaeryuntalkBackup/HomeView.jsx +178 -0
- package/dist/components/DaeryuntalkBackup/HomeView.tsx +261 -0
- package/dist/components/DaeryuntalkBackup/NavigationFooter.d.ts +11 -0
- package/dist/components/DaeryuntalkBackup/NavigationFooter.jsx +44 -0
- package/dist/components/DaeryuntalkBackup/NavigationFooter.tsx +98 -0
- package/dist/components/DaeryuntalkBackup/NoticeMessage.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/NoticeMessage.jsx +40 -0
- package/dist/components/DaeryuntalkBackup/NoticeMessage.tsx +60 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/DisabledInput.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/DisabledInput.jsx +17 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/DisabledInput.tsx +28 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/Tiptap.d.ts +20 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/Tiptap.jsx +130 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/Tiptap.tsx +181 -0
- package/dist/components/DaeryuntalkBackup/Toast/DaeryuntalkToastProvider.d.ts +23 -0
- package/dist/components/DaeryuntalkBackup/Toast/DaeryuntalkToastProvider.jsx +40 -0
- package/dist/components/DaeryuntalkBackup/Toast/DaeryuntalkToastProvider.tsx +70 -0
- package/dist/components/DaeryuntalkBackup/Toast/Toast.d.ts +11 -0
- package/dist/components/DaeryuntalkBackup/Toast/Toast.jsx +64 -0
- package/dist/components/DaeryuntalkBackup/Toast/Toast.tsx +98 -0
- package/dist/components/DaeryuntalkBackup/Toast/ToastRender.d.ts +1 -0
- package/dist/components/DaeryuntalkBackup/Toast/ToastRender.jsx +22 -0
- package/dist/components/DaeryuntalkBackup/Toast/ToastRender.tsx +30 -0
- package/dist/components/DaeryuntalkBackup/Viewer/ImageViewer.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/Viewer/ImageViewer.jsx +98 -0
- package/dist/components/DaeryuntalkBackup/Viewer/ImageViewer.tsx +138 -0
- package/dist/components/DaeryuntalkBackup/Viewer/MobileViewer.d.ts +18 -0
- package/dist/components/DaeryuntalkBackup/Viewer/MobileViewer.jsx +104 -0
- package/dist/components/DaeryuntalkBackup/Viewer/MobileViewer.tsx +182 -0
- package/dist/components/DaeryuntalkBackup/Viewer/TbPcViewer.d.ts +24 -0
- package/dist/components/DaeryuntalkBackup/Viewer/TbPcViewer.jsx +141 -0
- package/dist/components/DaeryuntalkBackup/Viewer/TbPcViewer.tsx +278 -0
- package/dist/components/DaeryuntalkBackup/ViewportHandler.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/ViewportHandler.jsx +25 -0
- package/dist/components/DaeryuntalkBackup/ViewportHandler.tsx +32 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/index.d.ts +177 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/index.js +801 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/index.ts +1097 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/type/response.d.ts +131 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/type/response.js +1 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/type/response.ts +159 -0
- package/dist/components/DaeryuntalkBackup/_api/index.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_api/index.js +6 -0
- package/dist/components/DaeryuntalkBackup/_api/index.ts +7 -0
- package/dist/components/DaeryuntalkBackup/_enums/ags_check_status.d.ts +5 -0
- package/dist/components/DaeryuntalkBackup/_enums/ags_check_status.js +9 -0
- package/dist/components/DaeryuntalkBackup/_enums/ags_check_status.ts +9 -0
- package/dist/components/DaeryuntalkBackup/_enums/ask-status.d.ts +13 -0
- package/dist/components/DaeryuntalkBackup/_enums/ask-status.js +25 -0
- package/dist/components/DaeryuntalkBackup/_enums/ask-status.ts +26 -0
- package/dist/components/DaeryuntalkBackup/_enums/error.d.ts +109 -0
- package/dist/components/DaeryuntalkBackup/_enums/error.js +254 -0
- package/dist/components/DaeryuntalkBackup/_enums/error.ts +289 -0
- package/dist/components/DaeryuntalkBackup/_enums/message_type.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_enums/message_type.js +13 -0
- package/dist/components/DaeryuntalkBackup/_enums/message_type.ts +13 -0
- package/dist/components/DaeryuntalkBackup/_enums/sender_type.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_enums/sender_type.js +16 -0
- package/dist/components/DaeryuntalkBackup/_enums/sender_type.ts +16 -0
- package/dist/components/DaeryuntalkBackup/_enums/socket_type.d.ts +34 -0
- package/dist/components/DaeryuntalkBackup/_enums/socket_type.js +46 -0
- package/dist/components/DaeryuntalkBackup/_enums/socket_type.ts +56 -0
- package/dist/components/DaeryuntalkBackup/_enums/template.d.ts +32 -0
- package/dist/components/DaeryuntalkBackup/_enums/template.js +76 -0
- package/dist/components/DaeryuntalkBackup/_enums/template.ts +81 -0
- package/dist/components/DaeryuntalkBackup/_enums/work_flow_object_expose.d.ts +33 -0
- package/dist/components/DaeryuntalkBackup/_enums/work_flow_object_expose.js +66 -0
- package/dist/components/DaeryuntalkBackup/_enums/work_flow_object_expose.ts +71 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useChatHandler.d.ts +48 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useChatHandler.js +465 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useChatHandler.ts +595 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useFullURL.d.ts +1 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useFullURL.jsx +15 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useFullURL.tsx +17 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useHistoryHandler.d.ts +24 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useHistoryHandler.js +112 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useHistoryHandler.ts +144 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useSocketEventHandler.d.ts +44 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useSocketEventHandler.js +534 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useSocketEventHandler.ts +706 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useViewerHook.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useViewerHook.js +18 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useViewerHook.ts +23 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.js +109 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.ts +121 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useHoverScrollbar.d.ts +12 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useHoverScrollbar.js +48 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useHoverScrollbar.ts +73 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useScrollShadow.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useScrollShadow.js +42 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useScrollShadow.ts +52 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useWindowSize.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useWindowSize.js +20 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useWindowSize.ts +30 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useChatSocketState.d.ts +2 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useChatSocketState.js +26 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useChatSocketState.ts +43 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHistoryView.d.ts +27 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHistoryView.js +80 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHistoryView.ts +101 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHomeView.d.ts +18 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHomeView.js +66 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHomeView.ts +75 -0
- package/dist/components/DaeryuntalkBackup/_lib/index.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/_lib/index.js +103 -0
- package/dist/components/DaeryuntalkBackup/_lib/index.ts +136 -0
- package/dist/components/DaeryuntalkBackup/_lib/utils.d.ts +17 -0
- package/dist/components/DaeryuntalkBackup/_lib/utils.js +94 -0
- package/dist/components/DaeryuntalkBackup/_lib/utils.ts +119 -0
- package/dist/components/DaeryuntalkBackup/_types/message.d.ts +92 -0
- package/dist/components/DaeryuntalkBackup/_types/message.js +25 -0
- package/dist/components/DaeryuntalkBackup/_types/message.ts +156 -0
- package/dist/components/DaeryuntalkBackup/_types/message_object.d.ts +17 -0
- package/dist/components/DaeryuntalkBackup/_types/message_object.js +1 -0
- package/dist/components/DaeryuntalkBackup/_types/message_object.ts +18 -0
- package/dist/components/DaeryuntalkBackup/_types/socket/workflow.d.ts +15 -0
- package/dist/components/DaeryuntalkBackup/_types/socket/workflow.js +1 -0
- package/dist/components/DaeryuntalkBackup/_types/socket/workflow.ts +15 -0
- package/dist/components/DaeryuntalkBackup/_ui/ShadowBox.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_ui/ShadowBox.jsx +5 -0
- package/dist/components/DaeryuntalkBackup/_ui/ShadowBox.tsx +15 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button1.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button1.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button1.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button2.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button2.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button2.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button3.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button3.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button3.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button4.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button4.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button4.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox1.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox1.jsx +15 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox1.tsx +38 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox2.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox2.jsx +21 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox2.tsx +50 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input1.d.ts +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input1.jsx +9 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input1.tsx +39 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input2.d.ts +13 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input2.jsx +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input2.tsx +43 -0
- package/dist/components/DaeryuntalkBackup/index.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/index.jsx +190 -0
- package/dist/components/DaeryuntalkBackup/index.tsx +261 -0
- package/dist/components/common/integrate/index.d.ts +1 -1
- package/dist/styles/globals.css +415 -410
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
hasBlocks,
|
|
5
|
+
hasCustomerWorkFlowClickData,
|
|
6
|
+
hasFileArray,
|
|
7
|
+
hasForm,
|
|
8
|
+
hasRichForm,
|
|
9
|
+
hasWorkFlow,
|
|
10
|
+
Message
|
|
11
|
+
} from './_types/message';
|
|
12
|
+
import Image from 'next/image';
|
|
13
|
+
import { MessageObject } from './_types/message_object';
|
|
14
|
+
import { ObjectNumber, WorkFlowBackOrInit, WorkFlowButtonUiCode } from './_enums/work_flow_object_expose';
|
|
15
|
+
import { MessageSenderType } from './_enums/sender_type';
|
|
16
|
+
import ObjectButton from './ChatObject/ObjectButton';
|
|
17
|
+
import ObjectBack from './ChatObject/ObjectBack';
|
|
18
|
+
import WorkFlowClickData from './ChatItem/WorkFlowClickData';
|
|
19
|
+
import WorkFlowImg from './ChatItem/WorkFlowImg';
|
|
20
|
+
import WorkFlowAuthForm from './ChatItem/WorkFlowAuthForm';
|
|
21
|
+
import ChatWrapper from './ChatItem/ChatWrapper';
|
|
22
|
+
import RichText from './ChatItem/RichText';
|
|
23
|
+
import ChatFile from './ChatItem/ChatFile';
|
|
24
|
+
import FieldWorkObject from './ChatObject/FieldWorkObject';
|
|
25
|
+
import TimeWrapper from './ChatItem/TimeWrapper';
|
|
26
|
+
import { InquiryStatusEnum } from './_enums/ask-status';
|
|
27
|
+
// 이미지
|
|
28
|
+
// import DaeryunLogoIcon from '../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
29
|
+
// import ResendIcon from '../../asset/images/daeryuntalk/re_send.svg';
|
|
30
|
+
|
|
31
|
+
type ChatMessageProps = {
|
|
32
|
+
message: Message;
|
|
33
|
+
object?: MessageObject | null;
|
|
34
|
+
handelObjectBack?: (data: {
|
|
35
|
+
chatInquiryNumber: string;
|
|
36
|
+
messageNumber: string;
|
|
37
|
+
workFlowNavigationCode: string;
|
|
38
|
+
}) => void;
|
|
39
|
+
chatInquiryNumber: string;
|
|
40
|
+
workFlowStack: string[];
|
|
41
|
+
isHovered: boolean;
|
|
42
|
+
scrollEnd: () => void;
|
|
43
|
+
inquiryStatus: string;
|
|
44
|
+
isMobile: boolean;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const ChatMessage: React.FC<ChatMessageProps> = ({
|
|
48
|
+
message,
|
|
49
|
+
object,
|
|
50
|
+
handelObjectBack,
|
|
51
|
+
chatInquiryNumber,
|
|
52
|
+
workFlowStack,
|
|
53
|
+
isHovered,
|
|
54
|
+
scrollEnd,
|
|
55
|
+
inquiryStatus,
|
|
56
|
+
isMobile
|
|
57
|
+
}) => {
|
|
58
|
+
// 고객 , 오퍼레이터 분리
|
|
59
|
+
const isOperator = message.senderType !== MessageSenderType.CUSTOMER;
|
|
60
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
61
|
+
const DaeryunLogoIcon = `${s3Url}/daeryuntalk/daeryun-logo.svg`;
|
|
62
|
+
const ResendIcon = `${s3Url}/daeryuntalk/re_send.svg`;
|
|
63
|
+
|
|
64
|
+
const formatTime = (date: Date): string => {
|
|
65
|
+
const hours = date.getHours().toString().padStart(2, '0');
|
|
66
|
+
const minutes = date.getMinutes().toString().padStart(2, '0');
|
|
67
|
+
return `${hours}:${minutes}`;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const time = formatTime(message.createdAt);
|
|
71
|
+
// {
|
|
72
|
+
// "blocks": [
|
|
73
|
+
// {
|
|
74
|
+
// "type": "text",
|
|
75
|
+
// "value": "궁금한 점이나 도움이 필요하신 부분\n말씀해 주시면 도와드리겠습니다.\n6:00~24:00 외 시간에는 상담인력의 편성에 따라 순차적으로 응대를 도와드리고 있습니다."
|
|
76
|
+
// }
|
|
77
|
+
// ],
|
|
78
|
+
// "created_at": "2025-07-17T00:31:33.201143265Z",
|
|
79
|
+
// "inquiry_number": "C9846633909467187913",
|
|
80
|
+
// "language": "ko",
|
|
81
|
+
// "message_number": "MSG91145971809777216",
|
|
82
|
+
// "message_status": "CREATED",
|
|
83
|
+
// "message_type": "MSP00200003",
|
|
84
|
+
// "plain_text": "궁금한 점이나 도움이 필요하신 부분\n말씀해 주시면 도와드리겠습니다.\n6:00~24:00 외 시간에는 상담인력의 편성에 따라 순차적으로 응대를 도와드리고 있습니다.",
|
|
85
|
+
// "sender_type": "MSP00100002",
|
|
86
|
+
// "template_type": "MSP00300202",
|
|
87
|
+
// "timestamp": 1752712293201143,
|
|
88
|
+
// "updated_at": "2025-07-17T00:31:33.201143265Z",
|
|
89
|
+
// "user_key": "",
|
|
90
|
+
// "work_flow": {
|
|
91
|
+
// "option_exposure_yn": true,
|
|
92
|
+
// "work_flow_number": "W210295281847689P001"
|
|
93
|
+
// }
|
|
94
|
+
// 텍스트 블록 렌더링
|
|
95
|
+
const renderText = (message: Message, isObject: boolean) => {
|
|
96
|
+
/**
|
|
97
|
+
* 메세지 UICode 기반으로 바꿔야할 듯함 ->
|
|
98
|
+
*
|
|
99
|
+
* MSP00300001 텍스트 -> 시스템 메시지 템플릿 1
|
|
100
|
+
* MSP00300101 텍스트+(이미지)+(파일) -> 시스템 메시지 템플릿 2
|
|
101
|
+
*
|
|
102
|
+
* MSP00300201 텍스트 -> 워크플로우 메시지 템플릿 1
|
|
103
|
+
* MSP00300202 워크플로우이미지+(텍스트) -> 워크플로우 메시지 템플릿 2
|
|
104
|
+
* MSP00300203 아이콘+텍스트 -> 워크플로우 메시지 템플릿 3
|
|
105
|
+
* MSP00300204 텍스트+폼 -> 워크플로우 메시지 템플릿 4
|
|
106
|
+
*
|
|
107
|
+
*
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
const isWorkFlow = hasWorkFlow(message);
|
|
111
|
+
const isBlock = hasBlocks(message);
|
|
112
|
+
const isWorkFlowCustomerClickData = hasCustomerWorkFlowClickData(message);
|
|
113
|
+
const isAuthForm = hasForm(message);
|
|
114
|
+
const isRichForm = hasRichForm(message);
|
|
115
|
+
const isFile = hasFileArray(message);
|
|
116
|
+
|
|
117
|
+
// 파일이 있는경우
|
|
118
|
+
if (isFile) {
|
|
119
|
+
return (
|
|
120
|
+
<div className={`flex flex-col gap-[10px]`}>
|
|
121
|
+
{/* 텍스트 + 파일인경우 */}
|
|
122
|
+
{isRichForm && (
|
|
123
|
+
<TimeWrapper time={time}>
|
|
124
|
+
<ChatWrapper isOperator={isOperator} className={` !w-fit `}>
|
|
125
|
+
<RichText message={message} />
|
|
126
|
+
</ChatWrapper>
|
|
127
|
+
</TimeWrapper>
|
|
128
|
+
)}
|
|
129
|
+
<ChatFile message={message} isOperator={isOperator} isHovered={isHovered} time={time} />
|
|
130
|
+
</div>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// 워크플로우 개인정보 인증 폼
|
|
135
|
+
if (isAuthForm) {
|
|
136
|
+
return (
|
|
137
|
+
<TimeWrapper time={time}>
|
|
138
|
+
<WorkFlowAuthForm message={message} isOperator={isOperator} />
|
|
139
|
+
</TimeWrapper>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
// 워크플로우 고객이 클릭한 내역
|
|
143
|
+
if (isWorkFlowCustomerClickData) {
|
|
144
|
+
return (
|
|
145
|
+
<TimeWrapper time={time} timePosition={'left'}>
|
|
146
|
+
<WorkFlowClickData message={message} />
|
|
147
|
+
</TimeWrapper>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// 워크플로우 이미지 -> ( 이미지 + 텍스트 ) 로 잡힐 예정
|
|
152
|
+
if (isWorkFlow) {
|
|
153
|
+
return (
|
|
154
|
+
<TimeWrapper time={time}>
|
|
155
|
+
<WorkFlowImg message={message} isOperator={isOperator} isMobile={isMobile} />
|
|
156
|
+
</TimeWrapper>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
if (isRichForm) {
|
|
160
|
+
return message.messageStatus === 'CREATED' ? (
|
|
161
|
+
<TimeWrapper time={time} timePosition={isOperator ? 'right' : 'left'}>
|
|
162
|
+
<ChatWrapper isOperator={isOperator} className={`w-[calc(100%-31.25px)]`}>
|
|
163
|
+
<RichText message={message} />
|
|
164
|
+
</ChatWrapper>
|
|
165
|
+
</TimeWrapper>
|
|
166
|
+
) : (
|
|
167
|
+
<div className={`flex w-full flex-row items-end gap-[8px] `}>
|
|
168
|
+
<button type={'button'} onClick={() => {}} className={`cursor-pointer`}>
|
|
169
|
+
<Image src={ResendIcon} alt="재전송" width={18} height={18} />
|
|
170
|
+
{/* <ResendIcon width={18} height={18} /> */}
|
|
171
|
+
</button>
|
|
172
|
+
<ChatWrapper isOperator={isOperator} className={`w-[calc(100%-31.25px)]`}>
|
|
173
|
+
<RichText message={message} />
|
|
174
|
+
</ChatWrapper>
|
|
175
|
+
</div>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return (
|
|
180
|
+
<TimeWrapper time={time}>
|
|
181
|
+
<ChatWrapper isOperator={isOperator}>
|
|
182
|
+
<p className="dr_talk_body_medium2 whitespace-pre-line">{message?.plainText}</p>
|
|
183
|
+
</ChatWrapper>
|
|
184
|
+
</TimeWrapper>
|
|
185
|
+
);
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const renderMessageContent = () => {
|
|
189
|
+
const objectFirstQuestionCheck = Array.isArray(object?.objectList)
|
|
190
|
+
? Object.values(ObjectNumber).every(enumValue =>
|
|
191
|
+
object?.objectList?.some(obj => obj?.objectNumber === enumValue)
|
|
192
|
+
)
|
|
193
|
+
: false;
|
|
194
|
+
|
|
195
|
+
const objectIsBack = workFlowStack.length >= 3;
|
|
196
|
+
|
|
197
|
+
const isObject = Boolean(object && object.exposeObjectListYn);
|
|
198
|
+
|
|
199
|
+
return (
|
|
200
|
+
<div
|
|
201
|
+
className={`
|
|
202
|
+
message-content mt-[10px]
|
|
203
|
+
`}
|
|
204
|
+
>
|
|
205
|
+
{renderText(message, isObject)}
|
|
206
|
+
{/* 오브젝트 박스 */}
|
|
207
|
+
{(inquiryStatus === InquiryStatusEnum.OPEN || inquiryStatus === InquiryStatusEnum.PERSONAL_INFO) &&
|
|
208
|
+
object &&
|
|
209
|
+
object.exposeObjectListYn && (
|
|
210
|
+
<div className={`mt-[10px] flex w-[calc(100%-35px)] flex-col gap-[10px] `}>
|
|
211
|
+
<div
|
|
212
|
+
className={`
|
|
213
|
+
${
|
|
214
|
+
WorkFlowButtonUiCode.TILE_BUTTON === object?.objectGroupUiCode
|
|
215
|
+
? 'flex flex-row flex-wrap gap-x-[4px] gap-y-[8px]'
|
|
216
|
+
: 'flex flex-col gap-[8px]'
|
|
217
|
+
}
|
|
218
|
+
`}
|
|
219
|
+
>
|
|
220
|
+
{WorkFlowButtonUiCode.TILE_BUTTON !== object?.objectGroupUiCode
|
|
221
|
+
? object.objectList
|
|
222
|
+
?.sort((a, b) => a.sequence - b.sequence)
|
|
223
|
+
?.map((item, index) => {
|
|
224
|
+
return (
|
|
225
|
+
<ObjectButton
|
|
226
|
+
key={`object-expose-${index}`}
|
|
227
|
+
object={item}
|
|
228
|
+
messageNumber={object?.messageNumber || ''}
|
|
229
|
+
workFlowNumber={message?.workFlow?.workFlowNumber || ''}
|
|
230
|
+
isFirstObject={objectFirstQuestionCheck}
|
|
231
|
+
objectGroupUiCode={object?.objectGroupUiCode || ''}
|
|
232
|
+
/>
|
|
233
|
+
);
|
|
234
|
+
})
|
|
235
|
+
: null}
|
|
236
|
+
{/* 더보기 들어간 타입 */}
|
|
237
|
+
{WorkFlowButtonUiCode.TILE_BUTTON === object?.objectGroupUiCode && (
|
|
238
|
+
<FieldWorkObject
|
|
239
|
+
object={object}
|
|
240
|
+
message={message}
|
|
241
|
+
isFirstObject={objectFirstQuestionCheck}
|
|
242
|
+
scrollEnd={scrollEnd}
|
|
243
|
+
/>
|
|
244
|
+
)}
|
|
245
|
+
</div>
|
|
246
|
+
{!objectFirstQuestionCheck && (
|
|
247
|
+
<ObjectBack
|
|
248
|
+
isBack={objectIsBack}
|
|
249
|
+
handleBtn={async () => {
|
|
250
|
+
if (handelObjectBack) {
|
|
251
|
+
await handelObjectBack({
|
|
252
|
+
chatInquiryNumber: chatInquiryNumber,
|
|
253
|
+
messageNumber: object?.messageNumber || '',
|
|
254
|
+
workFlowNavigationCode: objectIsBack
|
|
255
|
+
? WorkFlowBackOrInit.BACK
|
|
256
|
+
: WorkFlowBackOrInit.INIT
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}}
|
|
260
|
+
/>
|
|
261
|
+
)}
|
|
262
|
+
</div>
|
|
263
|
+
)}
|
|
264
|
+
</div>
|
|
265
|
+
);
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
return (
|
|
269
|
+
<div className={`mb-[20px] flex w-full ${isOperator ? 'justify-start' : 'justify-end'}`}>
|
|
270
|
+
{/* 시스템 or 오퍼레이터 */}
|
|
271
|
+
{isOperator ? (
|
|
272
|
+
<div className="flex flex-col">
|
|
273
|
+
<div className="flex items-center gap-[10px]">
|
|
274
|
+
<div className="flex-shrink-0 rounded-full">
|
|
275
|
+
<div className="relative h-full w-full">
|
|
276
|
+
<Image src={DaeryunLogoIcon} alt="대륜 로고" width={24} height={24} />
|
|
277
|
+
{/* <DaeryunLogoIcon width={24} height={24} /> */}
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
<span className="dr_talk_subtitle_medium text-drTalkBlack">법무법인(유한)대륜</span>
|
|
281
|
+
</div>
|
|
282
|
+
|
|
283
|
+
<div className="flex items-end pl-[34px]">{renderMessageContent()}</div>
|
|
284
|
+
</div>
|
|
285
|
+
) : (
|
|
286
|
+
// 유저
|
|
287
|
+
<div className="flex flex-col">
|
|
288
|
+
<div className="flex items-end">{renderMessageContent()}</div>
|
|
289
|
+
</div>
|
|
290
|
+
)}
|
|
291
|
+
</div>
|
|
292
|
+
);
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
export default ChatMessage;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MessageObject } from '../_types/message_object';
|
|
2
|
+
import { Message } from '../_types/message';
|
|
3
|
+
declare const FieldWorkObject: ({ object, message, isFirstObject, scrollEnd }: {
|
|
4
|
+
object: MessageObject;
|
|
5
|
+
message: Message;
|
|
6
|
+
isFirstObject: boolean;
|
|
7
|
+
scrollEnd: () => void;
|
|
8
|
+
}) => import("react").JSX.Element;
|
|
9
|
+
export default FieldWorkObject;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import ObjectButton from './ObjectButton';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
// 이미지
|
|
5
|
+
// import PlusIcon from '../../../asset/images/daeryuntalk/plus.svg';
|
|
6
|
+
// import MinusIcon from '../../../asset/images/daeryuntalk/minus.svg';
|
|
7
|
+
const FieldWorkObject = ({ object, message, isFirstObject, scrollEnd }) => {
|
|
8
|
+
var _a, _b;
|
|
9
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
10
|
+
const PlusIcon = `${s3Url}/daeryuntalk/plus.svg`;
|
|
11
|
+
const MinusIcon = `${s3Url}/daeryuntalk/minus.svg`;
|
|
12
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
13
|
+
const objectList = (_b = (_a = object === null || object === void 0 ? void 0 : object.objectList) === null || _a === void 0 ? void 0 : _a.sort((a, b) => a.sequence - b.sequence)) !== null && _b !== void 0 ? _b : [];
|
|
14
|
+
const MAX_VISIBLE = 10;
|
|
15
|
+
const hasMoreThanMax = objectList.length > MAX_VISIBLE;
|
|
16
|
+
const visibleList = isExpanded ? objectList : objectList.slice(0, MAX_VISIBLE);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (isExpanded) {
|
|
19
|
+
scrollEnd();
|
|
20
|
+
}
|
|
21
|
+
}, [isExpanded]);
|
|
22
|
+
return (<>
|
|
23
|
+
{visibleList.map((item, index) => {
|
|
24
|
+
var _a;
|
|
25
|
+
return (<ObjectButton key={`object-expose-${index}`} object={item} messageNumber={(object === null || object === void 0 ? void 0 : object.messageNumber) || ''} workFlowNumber={((_a = message === null || message === void 0 ? void 0 : message.workFlow) === null || _a === void 0 ? void 0 : _a.workFlowNumber) || ''} isFirstObject={isFirstObject} objectGroupUiCode={(object === null || object === void 0 ? void 0 : object.objectGroupUiCode) || ''}/>);
|
|
26
|
+
})}
|
|
27
|
+
|
|
28
|
+
{hasMoreThanMax && (<button type="button" onClick={() => {
|
|
29
|
+
setIsExpanded(prev => !prev);
|
|
30
|
+
}} className={`flex h-[36px] w-full items-center justify-center gap-[4px] rounded-[20px] bg-drTalkGrayscale5 `}>
|
|
31
|
+
{/* {isExpanded ? <MinusIcon /> : <PlusIcon />} */}
|
|
32
|
+
{isExpanded ? (<Image src={MinusIcon} alt="접기" width={18} height={18}/>) : (<Image src={PlusIcon} alt="더보기" width={13} height={12}/>)}
|
|
33
|
+
<span className={`dr_talk_subtitle_medium2 text-drTalkGrayscale2 `}>
|
|
34
|
+
{isExpanded ? '접기' : '더보기'}
|
|
35
|
+
</span>
|
|
36
|
+
</button>)}
|
|
37
|
+
</>);
|
|
38
|
+
};
|
|
39
|
+
export default FieldWorkObject;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import ObjectButton from './ObjectButton';
|
|
3
|
+
import { MessageObject, MessageObjectExpose } from '../_types/message_object';
|
|
4
|
+
import { Message } from '../_types/message'; // 실제 경로에 맞게 수정하세요
|
|
5
|
+
import Image from 'next/image';
|
|
6
|
+
// 이미지
|
|
7
|
+
// import PlusIcon from '../../../asset/images/daeryuntalk/plus.svg';
|
|
8
|
+
// import MinusIcon from '../../../asset/images/daeryuntalk/minus.svg';
|
|
9
|
+
|
|
10
|
+
const FieldWorkObject = ({
|
|
11
|
+
object,
|
|
12
|
+
message,
|
|
13
|
+
isFirstObject,
|
|
14
|
+
scrollEnd
|
|
15
|
+
}: {
|
|
16
|
+
object: MessageObject;
|
|
17
|
+
message: Message;
|
|
18
|
+
isFirstObject: boolean;
|
|
19
|
+
scrollEnd: () => void;
|
|
20
|
+
}) => {
|
|
21
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
22
|
+
const PlusIcon = `${s3Url}/daeryuntalk/plus.svg`;
|
|
23
|
+
const MinusIcon = `${s3Url}/daeryuntalk/minus.svg`;
|
|
24
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
25
|
+
|
|
26
|
+
const objectList: MessageObjectExpose[] = object?.objectList?.sort((a, b) => a.sequence - b.sequence) ?? [];
|
|
27
|
+
|
|
28
|
+
const MAX_VISIBLE = 10;
|
|
29
|
+
const hasMoreThanMax = objectList.length > MAX_VISIBLE;
|
|
30
|
+
|
|
31
|
+
const visibleList = isExpanded ? objectList : objectList.slice(0, MAX_VISIBLE);
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (isExpanded) {
|
|
35
|
+
scrollEnd();
|
|
36
|
+
}
|
|
37
|
+
}, [isExpanded]);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
{visibleList.map((item, index) => (
|
|
42
|
+
<ObjectButton
|
|
43
|
+
key={`object-expose-${index}`}
|
|
44
|
+
object={item}
|
|
45
|
+
messageNumber={object?.messageNumber || ''}
|
|
46
|
+
workFlowNumber={message?.workFlow?.workFlowNumber || ''}
|
|
47
|
+
isFirstObject={isFirstObject}
|
|
48
|
+
objectGroupUiCode={object?.objectGroupUiCode || ''}
|
|
49
|
+
/>
|
|
50
|
+
))}
|
|
51
|
+
|
|
52
|
+
{hasMoreThanMax && (
|
|
53
|
+
<button
|
|
54
|
+
type="button"
|
|
55
|
+
onClick={() => {
|
|
56
|
+
setIsExpanded(prev => !prev);
|
|
57
|
+
}}
|
|
58
|
+
className={`flex h-[36px] w-full items-center justify-center gap-[4px] rounded-[20px] bg-drTalkGrayscale5 `}
|
|
59
|
+
>
|
|
60
|
+
{/* {isExpanded ? <MinusIcon /> : <PlusIcon />} */}
|
|
61
|
+
{isExpanded ? (
|
|
62
|
+
<Image src={MinusIcon} alt="접기" width={18} height={18} />
|
|
63
|
+
) : (
|
|
64
|
+
<Image src={PlusIcon} alt="더보기" width={13} height={12} />
|
|
65
|
+
)}
|
|
66
|
+
<span className={`dr_talk_subtitle_medium2 text-drTalkGrayscale2 `}>
|
|
67
|
+
{isExpanded ? '접기' : '더보기'}
|
|
68
|
+
</span>
|
|
69
|
+
</button>
|
|
70
|
+
)}
|
|
71
|
+
</>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default FieldWorkObject;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
const ObjectBack = ({ isBack, handleBtn }) => {
|
|
5
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
6
|
+
const BackIcon = `${s3Url}/daeryuntalk/objectBack.svg`;
|
|
7
|
+
const FirstGoICon = `${s3Url}/daeryuntalk/firstGo.svg`;
|
|
8
|
+
return (<button type={'button'} onClick={() => {
|
|
9
|
+
if (handleBtn) {
|
|
10
|
+
handleBtn();
|
|
11
|
+
}
|
|
12
|
+
}} className={`flex flex-row items-center gap-[4px] `}>
|
|
13
|
+
{/* {isBack ? <BackIcon /> : <FirstGoICon />} */}
|
|
14
|
+
{isBack ? (<Image src={BackIcon} alt="이전" width={16} height={16}/>) : (<Image src={FirstGoICon} alt="처음" width={16} height={16}/>)}
|
|
15
|
+
<p className={` dr_talk_body_medium2 text-[14px] text-drTalkGrayscale1 `}>
|
|
16
|
+
{isBack ? '이전으로' : '처음으로'}
|
|
17
|
+
</p>
|
|
18
|
+
</button>);
|
|
19
|
+
};
|
|
20
|
+
export default ObjectBack;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
// 이미지
|
|
5
|
+
// import BackIcon from '../../../asset/images/daeryuntalk/objectBack.svg';
|
|
6
|
+
// import FirstGoICon from '../../../asset/images/daeryuntalk/firstGo.svg';
|
|
7
|
+
|
|
8
|
+
interface props {
|
|
9
|
+
isBack: boolean;
|
|
10
|
+
handleBtn?: () => void;
|
|
11
|
+
}
|
|
12
|
+
const ObjectBack = ({ isBack, handleBtn }: props) => {
|
|
13
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
14
|
+
const BackIcon = `${s3Url}/daeryuntalk/objectBack.svg`;
|
|
15
|
+
const FirstGoICon = `${s3Url}/daeryuntalk/firstGo.svg`;
|
|
16
|
+
return (
|
|
17
|
+
<button
|
|
18
|
+
type={'button'}
|
|
19
|
+
onClick={() => {
|
|
20
|
+
if (handleBtn) {
|
|
21
|
+
handleBtn();
|
|
22
|
+
}
|
|
23
|
+
}}
|
|
24
|
+
className={`flex flex-row items-center gap-[4px] `}
|
|
25
|
+
>
|
|
26
|
+
{/* {isBack ? <BackIcon /> : <FirstGoICon />} */}
|
|
27
|
+
{isBack ? (
|
|
28
|
+
<Image src={BackIcon} alt="이전" width={16} height={16} />
|
|
29
|
+
) : (
|
|
30
|
+
<Image src={FirstGoICon} alt="처음" width={16} height={16} />
|
|
31
|
+
)}
|
|
32
|
+
<p className={` dr_talk_body_medium2 text-[14px] text-drTalkGrayscale1 `}>
|
|
33
|
+
{isBack ? '이전으로' : '처음으로'}
|
|
34
|
+
</p>
|
|
35
|
+
</button>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default ObjectBack;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MessageObjectExpose } from '../_types/message_object';
|
|
3
|
+
declare const ObjectButton: ({ object, messageNumber, workFlowNumber, isFirstObject, objectGroupUiCode }: {
|
|
4
|
+
object: MessageObjectExpose;
|
|
5
|
+
messageNumber: string;
|
|
6
|
+
workFlowNumber: string;
|
|
7
|
+
isFirstObject: boolean;
|
|
8
|
+
objectGroupUiCode: string;
|
|
9
|
+
}) => React.JSX.Element;
|
|
10
|
+
export default ObjectButton;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import Image from 'next/image';
|
|
13
|
+
import { ObjectNumber, WorkFlowButtonActionType, WorkFlowButtonUiCode } from '../_enums/work_flow_object_expose';
|
|
14
|
+
import { useDaeryuntalk } from '../DaeryuntalkContext';
|
|
15
|
+
import { useRouter } from 'next/navigation';
|
|
16
|
+
import { useWorkFlow } from '../_hooks/talkprovider/useWorkFlow';
|
|
17
|
+
// 길이 fit 형
|
|
18
|
+
// 길이 full 형
|
|
19
|
+
// 업무 그룹형
|
|
20
|
+
// link_url
|
|
21
|
+
const ObjectButton = ({ object, messageNumber, workFlowNumber, isFirstObject = false, objectGroupUiCode }) => {
|
|
22
|
+
const { startWorkFlow, chatInquiryNumber, workFlowStack, workFlowBack, tel, setMessageObject, setWorkFlowStack } = useDaeryuntalk();
|
|
23
|
+
const { onClickKakao, onClickTel } = useWorkFlow({ tel: tel });
|
|
24
|
+
const router = useRouter();
|
|
25
|
+
const openExternalLink = (url) => {
|
|
26
|
+
window.open(url, '_blank', 'noopener,noreferrer');
|
|
27
|
+
};
|
|
28
|
+
const fitClassName = `
|
|
29
|
+
flex w-fit flex-row items-center gap-[6px] rounded-[4px] border-[1px]
|
|
30
|
+
border-solid border-drTalkGrayscale4 bg-drTalkGrayscale5 bg-opacity-50 h-[40px] px-[10px]
|
|
31
|
+
dr_talk_body_medium2
|
|
32
|
+
`;
|
|
33
|
+
const fullClassName = `
|
|
34
|
+
flex w-full flex-row items-center justify-center gap-[6px] rounded-[4px] border-[1px]
|
|
35
|
+
border-solid border-drTalkGrayscale4 bg-drTalkGrayscale5 bg-opacity-50 h-[40px]
|
|
36
|
+
dr_talk_body_medium2
|
|
37
|
+
`;
|
|
38
|
+
const workTypeClassName = `
|
|
39
|
+
flex w-fit flex-row items-center justify-center gap-[4px] rounded-[20px] border-[1px]
|
|
40
|
+
border-solid border-drTalkGrayscale4 bg-white h-[32px] px-[10px]
|
|
41
|
+
dr_talk_body_medium2
|
|
42
|
+
`;
|
|
43
|
+
const handleButton = (object) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
+
const actionType = (object === null || object === void 0 ? void 0 : object.actionCode) || '';
|
|
45
|
+
// 내부링크
|
|
46
|
+
if (actionType === WorkFlowButtonActionType.INTERNAL_LINK) {
|
|
47
|
+
}
|
|
48
|
+
// 외부링크
|
|
49
|
+
else if (actionType === WorkFlowButtonActionType.EXTERNAL_LINK) {
|
|
50
|
+
openExternalLink(object.linkUrl);
|
|
51
|
+
}
|
|
52
|
+
// 입력
|
|
53
|
+
else if (actionType === WorkFlowButtonActionType.INPUT) {
|
|
54
|
+
}
|
|
55
|
+
// 워크플로우호출
|
|
56
|
+
else if (actionType === WorkFlowButtonActionType.WORKFLOW_CALL) {
|
|
57
|
+
yield startWorkFlow({
|
|
58
|
+
chatInquiryNumber: chatInquiryNumber || '',
|
|
59
|
+
messageNumber: messageNumber,
|
|
60
|
+
workFlowNumber: workFlowNumber,
|
|
61
|
+
objectNumber: (object === null || object === void 0 ? void 0 : object.objectNumber) || ''
|
|
62
|
+
});
|
|
63
|
+
if (object.objectNumber === ObjectNumber.START_CHAT) {
|
|
64
|
+
setMessageObject(null);
|
|
65
|
+
setWorkFlowStack([]);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// 전화연결
|
|
69
|
+
else if (actionType === WorkFlowButtonActionType.PHONE_CALL) {
|
|
70
|
+
onClickTel();
|
|
71
|
+
router.push(`tel:${tel}`);
|
|
72
|
+
}
|
|
73
|
+
// 카카오연동
|
|
74
|
+
else if (actionType === WorkFlowButtonActionType.KAKAO_CONNECT) {
|
|
75
|
+
onClickKakao();
|
|
76
|
+
openExternalLink('https://pf.kakao.com/_xgxoTlK/chat');
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
const renderButton = (className) => {
|
|
80
|
+
return (<button type="button" onClick={() => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
|
+
yield handleButton(object);
|
|
82
|
+
})} className={`${className}`}>
|
|
83
|
+
<div className="h-[18px] w-[18px]">
|
|
84
|
+
<Image src={object.iconImageUrl} width={18} height={18} alt={object.objectName} className="h-[18px] w-[18px] object-cover"/>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div className="flex items-center">
|
|
88
|
+
{isFirstObject ? objectListRender(object.objectNumber) : object.objectName}
|
|
89
|
+
</div>
|
|
90
|
+
</button>);
|
|
91
|
+
};
|
|
92
|
+
const filterClassName = () => {
|
|
93
|
+
switch (objectGroupUiCode) {
|
|
94
|
+
case WorkFlowButtonUiCode.LEFT_FIT_BUTTON:
|
|
95
|
+
return fitClassName;
|
|
96
|
+
case WorkFlowButtonUiCode.FULL_BUTTON:
|
|
97
|
+
return fullClassName;
|
|
98
|
+
case WorkFlowButtonUiCode.TILE_BUTTON:
|
|
99
|
+
return workTypeClassName;
|
|
100
|
+
default:
|
|
101
|
+
return fitClassName; // 기본값
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
if (isFirstObject) {
|
|
105
|
+
return <>{renderButton(fitClassName)}</>;
|
|
106
|
+
}
|
|
107
|
+
return <>{renderButton(filterClassName())}</>;
|
|
108
|
+
};
|
|
109
|
+
export default ObjectButton;
|
|
110
|
+
// 예외케이스
|
|
111
|
+
const objectListRender = (objectNumber) => {
|
|
112
|
+
switch (objectNumber) {
|
|
113
|
+
case ObjectNumber.FIRST_VISIT:
|
|
114
|
+
return (<>
|
|
115
|
+
대륜에 <span className="font-[700]">처음 방문</span> 하셨나요?
|
|
116
|
+
</>);
|
|
117
|
+
case ObjectNumber.START_CHAT:
|
|
118
|
+
return (<>
|
|
119
|
+
<span className="font-[700]">채팅 문의</span> 시작하기
|
|
120
|
+
</>);
|
|
121
|
+
// case ObjectNumber.ASK_AI:
|
|
122
|
+
// return (
|
|
123
|
+
// <>
|
|
124
|
+
// <span className="font-[700]">AI 대륜</span>에게 질문하기
|
|
125
|
+
// </>
|
|
126
|
+
// );
|
|
127
|
+
case ObjectNumber.OTHER_RESERVATION:
|
|
128
|
+
return (<>
|
|
129
|
+
다른 <span className="font-[700]">예약 방법</span> 보기
|
|
130
|
+
</>);
|
|
131
|
+
case ObjectNumber.FAQ:
|
|
132
|
+
return (<>
|
|
133
|
+
자주 묻는 <span className="font-[700]">질문</span>
|
|
134
|
+
</>);
|
|
135
|
+
default:
|
|
136
|
+
return <>{objectNumber}</>;
|
|
137
|
+
}
|
|
138
|
+
};
|