sdy

update bot message

......@@ -7,17 +7,19 @@ import axios from "axios";
import Header from "../header/Header";
//const regExp = /<a[\s]+([^>]+)>((?:.(?!\<\/a\>))*.)<\/a>/g;
const BotOptions = ({ option }) => {
return (
<div className={'msg label bot'}>{option.label}</div>
);
}
const BotMsg = ({bot}) => {
const BotMsg = ({ bot }) => {
if (bot.response_type === 'text') {
return (
<div className={'msg bot'}>{bot.text}</div>
);
<div dangerouslySetInnerHTML={ {__html: bot.text } } className={'msg bot'}></div>
)
} else if (bot.response_type === 'option') {
console.log("bot : ", bot);
return (
......@@ -70,11 +72,6 @@ const Chat = ({ chat, userMsg, botMsg, botOption, userMessage, sendMessage }) =>
}
}, []);
console.log("chats : ", chat);
console.log("userMsg : ", userMsg);
console.log("botMsg : ", botMsg);
console.log("botOptions : ", botOption);
return (
<div className="chat">
<Header />
......