Fixed bug on chatMessage

This commit is contained in:
Lucas Oliveira 2023-07-11 20:33:46 -03:00
commit d15c5636a2

View file

@ -150,8 +150,8 @@ export default function ChatMessage({
</div>
</div>
) : (
<div className="flex flex-col">
{template && (
<div>
{template ? (
<>
<button
className="form-modal-initial-prompt-btn"
@ -167,8 +167,8 @@ export default function ChatMessage({
/>
</button>
<span className="prose inline-block break-words text-primary dark:prose-invert">
{promptOpen &&
template?.split("\n")?.map((line, index) => {
{promptOpen
? template?.split("\n")?.map((line, index) => {
const regex = /{([^}]+)}/g;
let match;
let parts = [];
@ -195,12 +195,13 @@ export default function ChatMessage({
parts.push(line.substring(lastIndex));
}
return <p>{parts}</p>;
})}
})
: chat.message[chat.chatKey]}
</span>
</>
)}
<br />
) : (
<span>{chat.message[chat.chatKey]}</span>
)}
</div>
)}
</div>