@daeryun/dr_components 1.2.17 → 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/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/banner/TopBanner.jsx +2 -2
- package/dist/components/banner/TopBanner.tsx +4 -2
- package/dist/styles/globals.css +5 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import { InquiryMessageTemplateType } from '../_enums/template';
|
|
5
|
+
import DOMPurify from 'dompurify';
|
|
6
|
+
import ChatWrapper from './ChatWrapper';
|
|
7
|
+
import { decodeDoubleEscapedHtml } from '../_lib/utils';
|
|
8
|
+
import { useWindowSize } from '../_hooks/useWindowSize';
|
|
9
|
+
const WorkFlowImg = ({ message, isOperator, isMobile }) => {
|
|
10
|
+
var _a, _b, _c, _d;
|
|
11
|
+
const workFlowItem = message.workFlow;
|
|
12
|
+
const messageType = (message === null || message === void 0 ? void 0 : message.templateType) || '';
|
|
13
|
+
const windowSize = useWindowSize();
|
|
14
|
+
// 워크플로우 메시지 템플릿 1 : 텍스트
|
|
15
|
+
if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_1) {
|
|
16
|
+
return <ChatWrapper isOperator={isOperator}>{(_a = message === null || message === void 0 ? void 0 : message.blocks) === null || _a === void 0 ? void 0 : _a.map(item => item === null || item === void 0 ? void 0 : item.value)}</ChatWrapper>;
|
|
17
|
+
}
|
|
18
|
+
// 워크플로우 메시지 템플릿 2 : 이미지 + 텍스트 (이미지)
|
|
19
|
+
if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_2) {
|
|
20
|
+
return (<>
|
|
21
|
+
{(workFlowItem === null || workFlowItem === void 0 ? void 0 : workFlowItem.imageUrl) ? (<div className={`flex h-auto flex-col overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}>
|
|
22
|
+
<Image src={(workFlowItem === null || workFlowItem === void 0 ? void 0 : workFlowItem.imageUrl) || ''} alt={''} width={500} height={300} className={`h-full w-full rounded-[10px] object-cover`} unoptimized={true}/>
|
|
23
|
+
{(message === null || message === void 0 ? void 0 : message.blocks) &&
|
|
24
|
+
((_b = message === null || message === void 0 ? void 0 : message.blocks) === null || _b === void 0 ? void 0 : _b.map((item, index) => {
|
|
25
|
+
const decoded = decodeDoubleEscapedHtml(item.value);
|
|
26
|
+
const shouldRemoveBr = windowSize.width <= 480 || isMobile;
|
|
27
|
+
const cleaned = shouldRemoveBr ? decoded.replace(/<br\s*\/?>/gi, ' ') : decoded;
|
|
28
|
+
// // 여기서 ,
|
|
29
|
+
// windowSize.width<=480 || isMobile 일 경우 <br/>은 제거시켜버리고 싶다
|
|
30
|
+
const sanitizedHtml = DOMPurify.sanitize(cleaned);
|
|
31
|
+
return <div key={index} dangerouslySetInnerHTML={{ __html: sanitizedHtml }}/>;
|
|
32
|
+
}))}
|
|
33
|
+
</div>) : ((message === null || message === void 0 ? void 0 : message.blocks) && (<ChatWrapper isOperator={isOperator}>{(_c = message === null || message === void 0 ? void 0 : message.blocks) === null || _c === void 0 ? void 0 : _c.map(item => item === null || item === void 0 ? void 0 : item.value)}</ChatWrapper>))}
|
|
34
|
+
</>);
|
|
35
|
+
}
|
|
36
|
+
// 워크플로우 메시지 템플릿 3 : 아이콘 + 텍스트
|
|
37
|
+
if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_3) {
|
|
38
|
+
return (<>
|
|
39
|
+
{/*{message?.blocks && (*/}
|
|
40
|
+
{/* <ChatWrapper isOperator={isOperator}>{message?.blocks?.map(item => item?.value)}</ChatWrapper>*/}
|
|
41
|
+
{/*)}*/}
|
|
42
|
+
{(workFlowItem === null || workFlowItem === void 0 ? void 0 : workFlowItem.imageUrl) && (<div className={`flex h-auto flex-col overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}>
|
|
43
|
+
<Image src={(workFlowItem === null || workFlowItem === void 0 ? void 0 : workFlowItem.imageUrl) || ''} alt={''} width={500} height={300} className={`h-full w-full rounded-[10px] object-cover`} unoptimized={true}/>
|
|
44
|
+
{(message === null || message === void 0 ? void 0 : message.blocks) &&
|
|
45
|
+
((_d = message === null || message === void 0 ? void 0 : message.blocks) === null || _d === void 0 ? void 0 : _d.map((item, index) => {
|
|
46
|
+
const decoded = decodeDoubleEscapedHtml(item.value);
|
|
47
|
+
const sanitizedHtml = DOMPurify.sanitize(decoded);
|
|
48
|
+
return <div key={index} dangerouslySetInnerHTML={{ __html: sanitizedHtml }}/>;
|
|
49
|
+
}))}
|
|
50
|
+
</div>)}
|
|
51
|
+
</>);
|
|
52
|
+
}
|
|
53
|
+
// 워크플로우 메시지 템플릿 4 : 텍스트 + form
|
|
54
|
+
if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_4) {
|
|
55
|
+
}
|
|
56
|
+
// const case1 = `
|
|
57
|
+
// <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; color: #000;">
|
|
58
|
+
// <div style="display: flex; height: 30px; align-items: flex-start; justify-content: center; border-bottom: 1px solid #EDEDED; text-align: center; font-size: 16px; font-weight: 700; line-height: 140%; letter-spacing: -4%; color: #000;">
|
|
59
|
+
// 대륜의 <span style="color: #AA1D36;">차별화</span>된
|
|
60
|
+
// <span style="color: #AA1D36;">조력 시스템</span>
|
|
61
|
+
// </div>
|
|
62
|
+
//
|
|
63
|
+
// <div style="display: flex; flex-direction: column; font-size: 16px; font-weight: 400; line-height: 100%; letter-spacing: -4%;">
|
|
64
|
+
// <div style="display: flex; flex-direction: row; align-items: center; height: 24px;">
|
|
65
|
+
// <div style="display: flex; height: 24px; width: 24px; align-items: center; justify-content: center;">
|
|
66
|
+
// <svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
67
|
+
// <path
|
|
68
|
+
// d="M9.5 1L4.5 7.5L1.5 4"
|
|
69
|
+
// stroke="#AA1D36"
|
|
70
|
+
// stroke-width="2"
|
|
71
|
+
// stroke-linecap="round"
|
|
72
|
+
// stroke-linejoin="round"
|
|
73
|
+
// />
|
|
74
|
+
// </svg>
|
|
75
|
+
// </div>
|
|
76
|
+
// 전문 변호사 직접 상담
|
|
77
|
+
// </div>
|
|
78
|
+
//
|
|
79
|
+
// <div style="display: flex; flex-direction: row; align-items: center; height: 24px;">
|
|
80
|
+
// <div style="display: flex; height: 24px; width: 24px; align-items: center; justify-content: center;">
|
|
81
|
+
// <svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
82
|
+
// <path
|
|
83
|
+
// d="M9.5 1L4.5 7.5L1.5 4"
|
|
84
|
+
// stroke="#AA1D36"
|
|
85
|
+
// stroke-width="2"
|
|
86
|
+
// stroke-linecap="round"
|
|
87
|
+
// stroke-linejoin="round"
|
|
88
|
+
// />
|
|
89
|
+
// </svg>
|
|
90
|
+
// </div>
|
|
91
|
+
// 분야별 해결사례 데이터베이스
|
|
92
|
+
// </div>
|
|
93
|
+
//
|
|
94
|
+
// <div style="display: flex; flex-direction: row; align-items: center; height: 24px;">
|
|
95
|
+
// <div style="display: flex; height: 24px; width: 24px; align-items: center; justify-content: center;">
|
|
96
|
+
// <svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
97
|
+
// <path
|
|
98
|
+
// d="M9.5 1L4.5 7.5L1.5 4"
|
|
99
|
+
// stroke="#AA1D36"
|
|
100
|
+
// stroke-width="2"
|
|
101
|
+
// stroke-linecap="round"
|
|
102
|
+
// stroke-linejoin="round"
|
|
103
|
+
// />
|
|
104
|
+
// </svg>
|
|
105
|
+
// </div>
|
|
106
|
+
// 전국 사무소 운영
|
|
107
|
+
// </div>
|
|
108
|
+
// </div>
|
|
109
|
+
// </div>
|
|
110
|
+
// `;
|
|
111
|
+
//
|
|
112
|
+
// const case2 = `
|
|
113
|
+
// <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
|
|
114
|
+
// <div style="font-weight: 400;">
|
|
115
|
+
// <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">법무법인 대륜</span>은 다양한 분야의 법률<br/>
|
|
116
|
+
// 문제를 다루고 있습니다. 궁금하신 분<br/>야를 선택해 주세요.
|
|
117
|
+
// </div>
|
|
118
|
+
// </div>
|
|
119
|
+
// `;
|
|
120
|
+
//
|
|
121
|
+
// const case3 = `
|
|
122
|
+
// <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
|
|
123
|
+
// <div style="font-weight: 400;">
|
|
124
|
+
// 아래 버튼을 클릭하시면 <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">채팅 문의 외<br/>다른 방법</span>으로 빠르게 문의하실 수 있<br/>습니다.
|
|
125
|
+
// </div>
|
|
126
|
+
// </div>
|
|
127
|
+
// `;
|
|
128
|
+
//
|
|
129
|
+
// const case4 = `
|
|
130
|
+
// <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
|
|
131
|
+
// <div style="font-weight: 400;">
|
|
132
|
+
// 해당 사건에 <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">특화된 전문변호사</span>가<br/>토 후 신속한 대응 전략을 제시합니<br/>다.
|
|
133
|
+
// </div>
|
|
134
|
+
// </div>
|
|
135
|
+
// `;
|
|
136
|
+
//
|
|
137
|
+
// //
|
|
138
|
+
// const case5 = `
|
|
139
|
+
// <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; font-weight: 400; line-height: 140%; letter-spacing: -4%; color: #000000;">
|
|
140
|
+
// <div>
|
|
141
|
+
// 전화 상담을 이용하시면 가장 빠르게<br />관련 상담을 진행하실 수 있습니다.
|
|
142
|
+
// </div>
|
|
143
|
+
// <div>
|
|
144
|
+
// <span style="font-weight: 700; color: #AA1D36; ">T.</span> <span style="font-weight: 700; ">1800-7905</span>
|
|
145
|
+
// </div>
|
|
146
|
+
// </div>
|
|
147
|
+
// `;
|
|
148
|
+
// const case6 = `
|
|
149
|
+
// <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
|
|
150
|
+
// <div style="font-weight: 400;">
|
|
151
|
+
// <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">AI대륜</span>과 함께하면 법률상담이 더<br />쉬워집니다!
|
|
152
|
+
// </div>
|
|
153
|
+
// <div>
|
|
154
|
+
// <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">24시간 신속</span>하고
|
|
155
|
+
// <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">정확한 법률 정보</span>를<br />제공받고, 변호사 상담까지 빠르게 진<br />행하세요.
|
|
156
|
+
// </div>
|
|
157
|
+
// </div>
|
|
158
|
+
// `;
|
|
159
|
+
//
|
|
160
|
+
// const case7 = `
|
|
161
|
+
// <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; font-weight: 400; line-height: 140%; letter-spacing: -4%; color: #000000;">
|
|
162
|
+
// <div>
|
|
163
|
+
// 많은 고객님들께서 실제로 궁금해하<br />
|
|
164
|
+
// 셨던 질문을 정리해 두었습니다.
|
|
165
|
+
// </div>
|
|
166
|
+
// <div>
|
|
167
|
+
// 문의 전 확인하시면 더욱 빠르고<br />
|
|
168
|
+
// 정확한 안내가 가능합니다.
|
|
169
|
+
// </div>
|
|
170
|
+
// </div>
|
|
171
|
+
// `;
|
|
172
|
+
// const sanitizedHtml = DOMPurify.sanitize(case1);
|
|
173
|
+
return (<div className={`flex h-auto flex-col overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}>
|
|
174
|
+
<Image src={(workFlowItem === null || workFlowItem === void 0 ? void 0 : workFlowItem.imageUrl) || ''} alt={''} width={500} height={300} className={`h-full w-full rounded-[10px] object-cover`} unoptimized={true}/>
|
|
175
|
+
{/*<div dangerouslySetInnerHTML={{ __html: sanitizedHtml }} />*/}
|
|
176
|
+
</div>);
|
|
177
|
+
};
|
|
178
|
+
export default WorkFlowImg;
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import { Message } from '../_types/message';
|
|
5
|
+
import { InquiryMessageTemplateType } from '../_enums/template';
|
|
6
|
+
import DOMPurify from 'dompurify';
|
|
7
|
+
import ChatWrapper from './ChatWrapper';
|
|
8
|
+
import { decodeDoubleEscapedHtml } from '../_lib/utils';
|
|
9
|
+
import { useWindowSize } from '../_hooks/useWindowSize';
|
|
10
|
+
|
|
11
|
+
interface props {
|
|
12
|
+
message: Message;
|
|
13
|
+
isOperator: boolean;
|
|
14
|
+
isMobile: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const WorkFlowImg = ({ message, isOperator, isMobile }: props) => {
|
|
18
|
+
const workFlowItem = message.workFlow;
|
|
19
|
+
const messageType = message?.templateType || '';
|
|
20
|
+
const windowSize = useWindowSize();
|
|
21
|
+
// 워크플로우 메시지 템플릿 1 : 텍스트
|
|
22
|
+
if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_1) {
|
|
23
|
+
return <ChatWrapper isOperator={isOperator}>{message?.blocks?.map(item => item?.value)}</ChatWrapper>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// 워크플로우 메시지 템플릿 2 : 이미지 + 텍스트 (이미지)
|
|
27
|
+
if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_2) {
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
{workFlowItem?.imageUrl ? (
|
|
31
|
+
<div
|
|
32
|
+
className={`flex h-auto flex-col overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}
|
|
33
|
+
>
|
|
34
|
+
<Image
|
|
35
|
+
src={workFlowItem?.imageUrl || ''}
|
|
36
|
+
alt={''}
|
|
37
|
+
width={500}
|
|
38
|
+
height={300}
|
|
39
|
+
className={`h-full w-full rounded-[10px] object-cover`}
|
|
40
|
+
unoptimized={true}
|
|
41
|
+
/>
|
|
42
|
+
{message?.blocks &&
|
|
43
|
+
message?.blocks?.map((item, index) => {
|
|
44
|
+
const decoded = decodeDoubleEscapedHtml(item.value);
|
|
45
|
+
const shouldRemoveBr = windowSize.width <= 480 || isMobile;
|
|
46
|
+
const cleaned = shouldRemoveBr ? decoded.replace(/<br\s*\/?>/gi, ' ') : decoded;
|
|
47
|
+
|
|
48
|
+
// // 여기서 ,
|
|
49
|
+
// windowSize.width<=480 || isMobile 일 경우 <br/>은 제거시켜버리고 싶다
|
|
50
|
+
const sanitizedHtml = DOMPurify.sanitize(cleaned);
|
|
51
|
+
|
|
52
|
+
return <div key={index} dangerouslySetInnerHTML={{ __html: sanitizedHtml }} />;
|
|
53
|
+
})}
|
|
54
|
+
</div>
|
|
55
|
+
) : (
|
|
56
|
+
message?.blocks && (
|
|
57
|
+
<ChatWrapper isOperator={isOperator}>{message?.blocks?.map(item => item?.value)}</ChatWrapper>
|
|
58
|
+
)
|
|
59
|
+
)}
|
|
60
|
+
</>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 워크플로우 메시지 템플릿 3 : 아이콘 + 텍스트
|
|
65
|
+
if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_3) {
|
|
66
|
+
return (
|
|
67
|
+
<>
|
|
68
|
+
{/*{message?.blocks && (*/}
|
|
69
|
+
{/* <ChatWrapper isOperator={isOperator}>{message?.blocks?.map(item => item?.value)}</ChatWrapper>*/}
|
|
70
|
+
{/*)}*/}
|
|
71
|
+
{workFlowItem?.imageUrl && (
|
|
72
|
+
<div
|
|
73
|
+
className={`flex h-auto flex-col overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}
|
|
74
|
+
>
|
|
75
|
+
<Image
|
|
76
|
+
src={workFlowItem?.imageUrl || ''}
|
|
77
|
+
alt={''}
|
|
78
|
+
width={500}
|
|
79
|
+
height={300}
|
|
80
|
+
className={`h-full w-full rounded-[10px] object-cover`}
|
|
81
|
+
unoptimized={true}
|
|
82
|
+
/>
|
|
83
|
+
{message?.blocks &&
|
|
84
|
+
message?.blocks?.map((item, index) => {
|
|
85
|
+
const decoded = decodeDoubleEscapedHtml(item.value);
|
|
86
|
+
const sanitizedHtml = DOMPurify.sanitize(decoded);
|
|
87
|
+
|
|
88
|
+
return <div key={index} dangerouslySetInnerHTML={{ __html: sanitizedHtml }} />;
|
|
89
|
+
})}
|
|
90
|
+
</div>
|
|
91
|
+
)}
|
|
92
|
+
</>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// 워크플로우 메시지 템플릿 4 : 텍스트 + form
|
|
97
|
+
if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_4) {
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// const case1 = `
|
|
101
|
+
// <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; color: #000;">
|
|
102
|
+
// <div style="display: flex; height: 30px; align-items: flex-start; justify-content: center; border-bottom: 1px solid #EDEDED; text-align: center; font-size: 16px; font-weight: 700; line-height: 140%; letter-spacing: -4%; color: #000;">
|
|
103
|
+
// 대륜의 <span style="color: #AA1D36;">차별화</span>된
|
|
104
|
+
// <span style="color: #AA1D36;">조력 시스템</span>
|
|
105
|
+
// </div>
|
|
106
|
+
//
|
|
107
|
+
// <div style="display: flex; flex-direction: column; font-size: 16px; font-weight: 400; line-height: 100%; letter-spacing: -4%;">
|
|
108
|
+
// <div style="display: flex; flex-direction: row; align-items: center; height: 24px;">
|
|
109
|
+
// <div style="display: flex; height: 24px; width: 24px; align-items: center; justify-content: center;">
|
|
110
|
+
// <svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
111
|
+
// <path
|
|
112
|
+
// d="M9.5 1L4.5 7.5L1.5 4"
|
|
113
|
+
// stroke="#AA1D36"
|
|
114
|
+
// stroke-width="2"
|
|
115
|
+
// stroke-linecap="round"
|
|
116
|
+
// stroke-linejoin="round"
|
|
117
|
+
// />
|
|
118
|
+
// </svg>
|
|
119
|
+
// </div>
|
|
120
|
+
// 전문 변호사 직접 상담
|
|
121
|
+
// </div>
|
|
122
|
+
//
|
|
123
|
+
// <div style="display: flex; flex-direction: row; align-items: center; height: 24px;">
|
|
124
|
+
// <div style="display: flex; height: 24px; width: 24px; align-items: center; justify-content: center;">
|
|
125
|
+
// <svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
126
|
+
// <path
|
|
127
|
+
// d="M9.5 1L4.5 7.5L1.5 4"
|
|
128
|
+
// stroke="#AA1D36"
|
|
129
|
+
// stroke-width="2"
|
|
130
|
+
// stroke-linecap="round"
|
|
131
|
+
// stroke-linejoin="round"
|
|
132
|
+
// />
|
|
133
|
+
// </svg>
|
|
134
|
+
// </div>
|
|
135
|
+
// 분야별 해결사례 데이터베이스
|
|
136
|
+
// </div>
|
|
137
|
+
//
|
|
138
|
+
// <div style="display: flex; flex-direction: row; align-items: center; height: 24px;">
|
|
139
|
+
// <div style="display: flex; height: 24px; width: 24px; align-items: center; justify-content: center;">
|
|
140
|
+
// <svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
141
|
+
// <path
|
|
142
|
+
// d="M9.5 1L4.5 7.5L1.5 4"
|
|
143
|
+
// stroke="#AA1D36"
|
|
144
|
+
// stroke-width="2"
|
|
145
|
+
// stroke-linecap="round"
|
|
146
|
+
// stroke-linejoin="round"
|
|
147
|
+
// />
|
|
148
|
+
// </svg>
|
|
149
|
+
// </div>
|
|
150
|
+
// 전국 사무소 운영
|
|
151
|
+
// </div>
|
|
152
|
+
// </div>
|
|
153
|
+
// </div>
|
|
154
|
+
// `;
|
|
155
|
+
//
|
|
156
|
+
// const case2 = `
|
|
157
|
+
// <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
|
|
158
|
+
// <div style="font-weight: 400;">
|
|
159
|
+
// <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">법무법인 대륜</span>은 다양한 분야의 법률<br/>
|
|
160
|
+
// 문제를 다루고 있습니다. 궁금하신 분<br/>야를 선택해 주세요.
|
|
161
|
+
// </div>
|
|
162
|
+
// </div>
|
|
163
|
+
// `;
|
|
164
|
+
//
|
|
165
|
+
// const case3 = `
|
|
166
|
+
// <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
|
|
167
|
+
// <div style="font-weight: 400;">
|
|
168
|
+
// 아래 버튼을 클릭하시면 <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">채팅 문의 외<br/>다른 방법</span>으로 빠르게 문의하실 수 있<br/>습니다.
|
|
169
|
+
// </div>
|
|
170
|
+
// </div>
|
|
171
|
+
// `;
|
|
172
|
+
//
|
|
173
|
+
// const case4 = `
|
|
174
|
+
// <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
|
|
175
|
+
// <div style="font-weight: 400;">
|
|
176
|
+
// 해당 사건에 <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">특화된 전문변호사</span>가<br/>토 후 신속한 대응 전략을 제시합니<br/>다.
|
|
177
|
+
// </div>
|
|
178
|
+
// </div>
|
|
179
|
+
// `;
|
|
180
|
+
//
|
|
181
|
+
// //
|
|
182
|
+
// const case5 = `
|
|
183
|
+
// <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; font-weight: 400; line-height: 140%; letter-spacing: -4%; color: #000000;">
|
|
184
|
+
// <div>
|
|
185
|
+
// 전화 상담을 이용하시면 가장 빠르게<br />관련 상담을 진행하실 수 있습니다.
|
|
186
|
+
// </div>
|
|
187
|
+
// <div>
|
|
188
|
+
// <span style="font-weight: 700; color: #AA1D36; ">T.</span> <span style="font-weight: 700; ">1800-7905</span>
|
|
189
|
+
// </div>
|
|
190
|
+
// </div>
|
|
191
|
+
// `;
|
|
192
|
+
// const case6 = `
|
|
193
|
+
// <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
|
|
194
|
+
// <div style="font-weight: 400;">
|
|
195
|
+
// <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">AI대륜</span>과 함께하면 법률상담이 더<br />쉬워집니다!
|
|
196
|
+
// </div>
|
|
197
|
+
// <div>
|
|
198
|
+
// <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">24시간 신속</span>하고
|
|
199
|
+
// <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">정확한 법률 정보</span>를<br />제공받고, 변호사 상담까지 빠르게 진<br />행하세요.
|
|
200
|
+
// </div>
|
|
201
|
+
// </div>
|
|
202
|
+
// `;
|
|
203
|
+
//
|
|
204
|
+
// const case7 = `
|
|
205
|
+
// <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; font-weight: 400; line-height: 140%; letter-spacing: -4%; color: #000000;">
|
|
206
|
+
// <div>
|
|
207
|
+
// 많은 고객님들께서 실제로 궁금해하<br />
|
|
208
|
+
// 셨던 질문을 정리해 두었습니다.
|
|
209
|
+
// </div>
|
|
210
|
+
// <div>
|
|
211
|
+
// 문의 전 확인하시면 더욱 빠르고<br />
|
|
212
|
+
// 정확한 안내가 가능합니다.
|
|
213
|
+
// </div>
|
|
214
|
+
// </div>
|
|
215
|
+
// `;
|
|
216
|
+
// const sanitizedHtml = DOMPurify.sanitize(case1);
|
|
217
|
+
|
|
218
|
+
return (
|
|
219
|
+
<div className={`flex h-auto flex-col overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}>
|
|
220
|
+
<Image
|
|
221
|
+
src={workFlowItem?.imageUrl || ''}
|
|
222
|
+
alt={''}
|
|
223
|
+
width={500}
|
|
224
|
+
height={300}
|
|
225
|
+
className={`h-full w-full rounded-[10px] object-cover`}
|
|
226
|
+
unoptimized={true}
|
|
227
|
+
/>
|
|
228
|
+
{/*<div dangerouslySetInnerHTML={{ __html: sanitizedHtml }} />*/}
|
|
229
|
+
</div>
|
|
230
|
+
);
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
export default WorkFlowImg;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Message } from './_types/message';
|
|
3
|
+
import { MessageObject } from './_types/message_object';
|
|
4
|
+
type ChatMessageProps = {
|
|
5
|
+
message: Message;
|
|
6
|
+
object?: MessageObject | null;
|
|
7
|
+
handelObjectBack?: (data: {
|
|
8
|
+
chatInquiryNumber: string;
|
|
9
|
+
messageNumber: string;
|
|
10
|
+
workFlowNavigationCode: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
chatInquiryNumber: string;
|
|
13
|
+
workFlowStack: string[];
|
|
14
|
+
isHovered: boolean;
|
|
15
|
+
scrollEnd: () => void;
|
|
16
|
+
inquiryStatus: string;
|
|
17
|
+
isMobile: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare const ChatMessage: React.FC<ChatMessageProps>;
|
|
20
|
+
export default ChatMessage;
|
|
@@ -0,0 +1,198 @@
|
|
|
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 { hasBlocks, hasCustomerWorkFlowClickData, hasFileArray, hasForm, hasRichForm, hasWorkFlow } from './_types/message';
|
|
13
|
+
import Image from 'next/image';
|
|
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
|
+
const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, workFlowStack, isHovered, scrollEnd, inquiryStatus, isMobile }) => {
|
|
28
|
+
// 고객 , 오퍼레이터 분리
|
|
29
|
+
const isOperator = message.senderType !== MessageSenderType.CUSTOMER;
|
|
30
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
31
|
+
const DaeryunLogoIcon = `${s3Url}/daeryuntalk/daeryun-logo.svg`;
|
|
32
|
+
const ResendIcon = `${s3Url}/daeryuntalk/re_send.svg`;
|
|
33
|
+
const formatTime = (date) => {
|
|
34
|
+
const hours = date.getHours().toString().padStart(2, '0');
|
|
35
|
+
const minutes = date.getMinutes().toString().padStart(2, '0');
|
|
36
|
+
return `${hours}:${minutes}`;
|
|
37
|
+
};
|
|
38
|
+
const time = formatTime(message.createdAt);
|
|
39
|
+
// {
|
|
40
|
+
// "blocks": [
|
|
41
|
+
// {
|
|
42
|
+
// "type": "text",
|
|
43
|
+
// "value": "궁금한 점이나 도움이 필요하신 부분\n말씀해 주시면 도와드리겠습니다.\n6:00~24:00 외 시간에는 상담인력의 편성에 따라 순차적으로 응대를 도와드리고 있습니다."
|
|
44
|
+
// }
|
|
45
|
+
// ],
|
|
46
|
+
// "created_at": "2025-07-17T00:31:33.201143265Z",
|
|
47
|
+
// "inquiry_number": "C9846633909467187913",
|
|
48
|
+
// "language": "ko",
|
|
49
|
+
// "message_number": "MSG91145971809777216",
|
|
50
|
+
// "message_status": "CREATED",
|
|
51
|
+
// "message_type": "MSP00200003",
|
|
52
|
+
// "plain_text": "궁금한 점이나 도움이 필요하신 부분\n말씀해 주시면 도와드리겠습니다.\n6:00~24:00 외 시간에는 상담인력의 편성에 따라 순차적으로 응대를 도와드리고 있습니다.",
|
|
53
|
+
// "sender_type": "MSP00100002",
|
|
54
|
+
// "template_type": "MSP00300202",
|
|
55
|
+
// "timestamp": 1752712293201143,
|
|
56
|
+
// "updated_at": "2025-07-17T00:31:33.201143265Z",
|
|
57
|
+
// "user_key": "",
|
|
58
|
+
// "work_flow": {
|
|
59
|
+
// "option_exposure_yn": true,
|
|
60
|
+
// "work_flow_number": "W210295281847689P001"
|
|
61
|
+
// }
|
|
62
|
+
// 텍스트 블록 렌더링
|
|
63
|
+
const renderText = (message, isObject) => {
|
|
64
|
+
/**
|
|
65
|
+
* 메세지 UICode 기반으로 바꿔야할 듯함 ->
|
|
66
|
+
*
|
|
67
|
+
* MSP00300001 텍스트 -> 시스템 메시지 템플릿 1
|
|
68
|
+
* MSP00300101 텍스트+(이미지)+(파일) -> 시스템 메시지 템플릿 2
|
|
69
|
+
*
|
|
70
|
+
* MSP00300201 텍스트 -> 워크플로우 메시지 템플릿 1
|
|
71
|
+
* MSP00300202 워크플로우이미지+(텍스트) -> 워크플로우 메시지 템플릿 2
|
|
72
|
+
* MSP00300203 아이콘+텍스트 -> 워크플로우 메시지 템플릿 3
|
|
73
|
+
* MSP00300204 텍스트+폼 -> 워크플로우 메시지 템플릿 4
|
|
74
|
+
*
|
|
75
|
+
*
|
|
76
|
+
*/
|
|
77
|
+
const isWorkFlow = hasWorkFlow(message);
|
|
78
|
+
const isBlock = hasBlocks(message);
|
|
79
|
+
const isWorkFlowCustomerClickData = hasCustomerWorkFlowClickData(message);
|
|
80
|
+
const isAuthForm = hasForm(message);
|
|
81
|
+
const isRichForm = hasRichForm(message);
|
|
82
|
+
const isFile = hasFileArray(message);
|
|
83
|
+
// 파일이 있는경우
|
|
84
|
+
if (isFile) {
|
|
85
|
+
return (<div className={`flex flex-col gap-[10px]`}>
|
|
86
|
+
{/* 텍스트 + 파일인경우 */}
|
|
87
|
+
{isRichForm && (<TimeWrapper time={time}>
|
|
88
|
+
<ChatWrapper isOperator={isOperator} className={` !w-fit `}>
|
|
89
|
+
<RichText message={message}/>
|
|
90
|
+
</ChatWrapper>
|
|
91
|
+
</TimeWrapper>)}
|
|
92
|
+
<ChatFile message={message} isOperator={isOperator} isHovered={isHovered} time={time}/>
|
|
93
|
+
</div>);
|
|
94
|
+
}
|
|
95
|
+
// 워크플로우 개인정보 인증 폼
|
|
96
|
+
if (isAuthForm) {
|
|
97
|
+
return (<TimeWrapper time={time}>
|
|
98
|
+
<WorkFlowAuthForm message={message} isOperator={isOperator}/>
|
|
99
|
+
</TimeWrapper>);
|
|
100
|
+
}
|
|
101
|
+
// 워크플로우 고객이 클릭한 내역
|
|
102
|
+
if (isWorkFlowCustomerClickData) {
|
|
103
|
+
return (<TimeWrapper time={time} timePosition={'left'}>
|
|
104
|
+
<WorkFlowClickData message={message}/>
|
|
105
|
+
</TimeWrapper>);
|
|
106
|
+
}
|
|
107
|
+
// 워크플로우 이미지 -> ( 이미지 + 텍스트 ) 로 잡힐 예정
|
|
108
|
+
if (isWorkFlow) {
|
|
109
|
+
return (<TimeWrapper time={time}>
|
|
110
|
+
<WorkFlowImg message={message} isOperator={isOperator} isMobile={isMobile}/>
|
|
111
|
+
</TimeWrapper>);
|
|
112
|
+
}
|
|
113
|
+
if (isRichForm) {
|
|
114
|
+
return message.messageStatus === 'CREATED' ? (<TimeWrapper time={time} timePosition={isOperator ? 'right' : 'left'}>
|
|
115
|
+
<ChatWrapper isOperator={isOperator} className={`w-[calc(100%-31.25px)]`}>
|
|
116
|
+
<RichText message={message}/>
|
|
117
|
+
</ChatWrapper>
|
|
118
|
+
</TimeWrapper>) : (<div className={`flex w-full flex-row items-end gap-[8px] `}>
|
|
119
|
+
<button type={'button'} onClick={() => { }} className={`cursor-pointer`}>
|
|
120
|
+
<Image src={ResendIcon} alt="재전송" width={18} height={18}/>
|
|
121
|
+
{/* <ResendIcon width={18} height={18} /> */}
|
|
122
|
+
</button>
|
|
123
|
+
<ChatWrapper isOperator={isOperator} className={`w-[calc(100%-31.25px)]`}>
|
|
124
|
+
<RichText message={message}/>
|
|
125
|
+
</ChatWrapper>
|
|
126
|
+
</div>);
|
|
127
|
+
}
|
|
128
|
+
return (<TimeWrapper time={time}>
|
|
129
|
+
<ChatWrapper isOperator={isOperator}>
|
|
130
|
+
<p className="dr_talk_body_medium2 whitespace-pre-line">{message === null || message === void 0 ? void 0 : message.plainText}</p>
|
|
131
|
+
</ChatWrapper>
|
|
132
|
+
</TimeWrapper>);
|
|
133
|
+
};
|
|
134
|
+
const renderMessageContent = () => {
|
|
135
|
+
var _a, _b;
|
|
136
|
+
const objectFirstQuestionCheck = Array.isArray(object === null || object === void 0 ? void 0 : object.objectList)
|
|
137
|
+
? Object.values(ObjectNumber).every(enumValue => { var _a; return (_a = object === null || object === void 0 ? void 0 : object.objectList) === null || _a === void 0 ? void 0 : _a.some(obj => (obj === null || obj === void 0 ? void 0 : obj.objectNumber) === enumValue); })
|
|
138
|
+
: false;
|
|
139
|
+
const objectIsBack = workFlowStack.length >= 3;
|
|
140
|
+
const isObject = Boolean(object && object.exposeObjectListYn);
|
|
141
|
+
return (<div className={`
|
|
142
|
+
message-content mt-[10px]
|
|
143
|
+
`}>
|
|
144
|
+
{renderText(message, isObject)}
|
|
145
|
+
{/* 오브젝트 박스 */}
|
|
146
|
+
{(inquiryStatus === InquiryStatusEnum.OPEN || inquiryStatus === InquiryStatusEnum.PERSONAL_INFO) &&
|
|
147
|
+
object &&
|
|
148
|
+
object.exposeObjectListYn && (<div className={`mt-[10px] flex w-[calc(100%-35px)] flex-col gap-[10px] `}>
|
|
149
|
+
<div className={`
|
|
150
|
+
${WorkFlowButtonUiCode.TILE_BUTTON === (object === null || object === void 0 ? void 0 : object.objectGroupUiCode)
|
|
151
|
+
? 'flex flex-row flex-wrap gap-x-[4px] gap-y-[8px]'
|
|
152
|
+
: 'flex flex-col gap-[8px]'}
|
|
153
|
+
`}>
|
|
154
|
+
{WorkFlowButtonUiCode.TILE_BUTTON !== (object === null || object === void 0 ? void 0 : object.objectGroupUiCode)
|
|
155
|
+
? (_b = (_a = object.objectList) === null || _a === void 0 ? void 0 : _a.sort((a, b) => a.sequence - b.sequence)) === null || _b === void 0 ? void 0 : _b.map((item, index) => {
|
|
156
|
+
var _a;
|
|
157
|
+
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={objectFirstQuestionCheck} objectGroupUiCode={(object === null || object === void 0 ? void 0 : object.objectGroupUiCode) || ''}/>);
|
|
158
|
+
})
|
|
159
|
+
: null}
|
|
160
|
+
{/* 더보기 들어간 타입 */}
|
|
161
|
+
{WorkFlowButtonUiCode.TILE_BUTTON === (object === null || object === void 0 ? void 0 : object.objectGroupUiCode) && (<FieldWorkObject object={object} message={message} isFirstObject={objectFirstQuestionCheck} scrollEnd={scrollEnd}/>)}
|
|
162
|
+
</div>
|
|
163
|
+
{!objectFirstQuestionCheck && (<ObjectBack isBack={objectIsBack} handleBtn={() => __awaiter(void 0, void 0, void 0, function* () {
|
|
164
|
+
if (handelObjectBack) {
|
|
165
|
+
yield handelObjectBack({
|
|
166
|
+
chatInquiryNumber: chatInquiryNumber,
|
|
167
|
+
messageNumber: (object === null || object === void 0 ? void 0 : object.messageNumber) || '',
|
|
168
|
+
workFlowNavigationCode: objectIsBack
|
|
169
|
+
? WorkFlowBackOrInit.BACK
|
|
170
|
+
: WorkFlowBackOrInit.INIT
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
})}/>)}
|
|
174
|
+
</div>)}
|
|
175
|
+
</div>);
|
|
176
|
+
};
|
|
177
|
+
return (<div className={`mb-[20px] flex w-full ${isOperator ? 'justify-start' : 'justify-end'}`}>
|
|
178
|
+
{/* 시스템 or 오퍼레이터 */}
|
|
179
|
+
{isOperator ? (<div className="flex flex-col">
|
|
180
|
+
<div className="flex items-center gap-[10px]">
|
|
181
|
+
<div className="flex-shrink-0 rounded-full">
|
|
182
|
+
<div className="relative h-full w-full">
|
|
183
|
+
<Image src={DaeryunLogoIcon} alt="대륜 로고" width={24} height={24}/>
|
|
184
|
+
{/* <DaeryunLogoIcon width={24} height={24} /> */}
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
<span className="dr_talk_subtitle_medium text-drTalkBlack">법무법인(유한)대륜</span>
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
<div className="flex items-end pl-[34px]">{renderMessageContent()}</div>
|
|
191
|
+
</div>) : (
|
|
192
|
+
// 유저
|
|
193
|
+
<div className="flex flex-col">
|
|
194
|
+
<div className="flex items-end">{renderMessageContent()}</div>
|
|
195
|
+
</div>)}
|
|
196
|
+
</div>);
|
|
197
|
+
};
|
|
198
|
+
export default ChatMessage;
|