feat: add chunkText to messageText to distinguish table rows and when parsing, the delete and other buttons are set to disabled. (#130)

* feat: when parsing, the delete and other buttons are set to disabled.

* feat: add chunkText to messageText to distinguish table rows
This commit is contained in:
balibabu
2024-03-19 10:20:50 +08:00
committed by GitHub
parent c1734be59d
commit d56c9e7630
6 changed files with 57 additions and 14 deletions

View File

@ -25,6 +25,7 @@
flex-direction: row-reverse;
}
.messageText {
.chunkText();
padding: 0 14px;
background-color: rgba(249, 250, 251, 1);
word-break: break-all;

View File

@ -262,12 +262,12 @@ const ChatContainer = () => {
if (!loading) {
setValue('');
addNewestConversation(value);
sendMessage(value);
sendMessage(value.trim());
}
};
const handleInputChange: ChangeEventHandler<HTMLInputElement> = (e) => {
const value = e.target.value.trim();
const value = e.target.value;
const nextValue = value.replaceAll('\\n', '\n').replaceAll('\\t', '\t');
setValue(nextValue);
};