Showing
1 changed file
with
5 additions
and
8 deletions
... | @@ -7,17 +7,19 @@ import axios from "axios"; | ... | @@ -7,17 +7,19 @@ import axios from "axios"; |
7 | 7 | ||
8 | import Header from "../header/Header"; | 8 | import Header from "../header/Header"; |
9 | 9 | ||
10 | +//const regExp = /<a[\s]+([^>]+)>((?:.(?!\<\/a\>))*.)<\/a>/g; | ||
11 | + | ||
10 | const BotOptions = ({ option }) => { | 12 | const BotOptions = ({ option }) => { |
11 | return ( | 13 | return ( |
12 | <div className={'msg label bot'}>{option.label}</div> | 14 | <div className={'msg label bot'}>{option.label}</div> |
13 | ); | 15 | ); |
14 | } | 16 | } |
15 | 17 | ||
16 | -const BotMsg = ({bot}) => { | 18 | +const BotMsg = ({ bot }) => { |
17 | if (bot.response_type === 'text') { | 19 | if (bot.response_type === 'text') { |
18 | return ( | 20 | return ( |
19 | - <div className={'msg bot'}>{bot.text}</div> | 21 | + <div dangerouslySetInnerHTML={ {__html: bot.text } } className={'msg bot'}></div> |
20 | - ); | 22 | + ) |
21 | } else if (bot.response_type === 'option') { | 23 | } else if (bot.response_type === 'option') { |
22 | console.log("bot : ", bot); | 24 | console.log("bot : ", bot); |
23 | return ( | 25 | return ( |
... | @@ -70,11 +72,6 @@ const Chat = ({ chat, userMsg, botMsg, botOption, userMessage, sendMessage }) => | ... | @@ -70,11 +72,6 @@ const Chat = ({ chat, userMsg, botMsg, botOption, userMessage, sendMessage }) => |
70 | } | 72 | } |
71 | }, []); | 73 | }, []); |
72 | 74 | ||
73 | - console.log("chats : ", chat); | ||
74 | - console.log("userMsg : ", userMsg); | ||
75 | - console.log("botMsg : ", botMsg); | ||
76 | - console.log("botOptions : ", botOption); | ||
77 | - | ||
78 | return ( | 75 | return ( |
79 | <div className="chat"> | 76 | <div className="chat"> |
80 | <Header /> | 77 | <Header /> | ... | ... |
-
Please register or login to post a comment