- {currentConvoState?.waitingForResponse === true && (
-
-
-
- )}
- {!currentConvoState?.waitingForResponse &&
- currentConvoState?.error && (
-
-
- {currentConvoState?.error?.toString()}
-
-
- )}
+ {currentConvoState?.error && (
+
+
+ {currentConvoState?.error?.toString()}
+
+ )}
+
-
-
-
+ {/* My text input */}
+
);
diff --git a/web/app/_components/SendButton/index.tsx b/web/app/_components/SendButton/index.tsx
index 58052aa14..5d9fc7147 100644
--- a/web/app/_components/SendButton/index.tsx
+++ b/web/app/_components/SendButton/index.tsx
@@ -12,10 +12,6 @@ const SendButton: React.FC = () => {
const isWaitingForResponse = currentConvoState?.waitingForResponse ?? false;
const disabled = currentPrompt.trim().length === 0 || isWaitingForResponse;
- const enabledStyle = {
- backgroundColor: "#FACA15",
- };
-
const disabledStyle = {
backgroundColor: "#F3F4F6",
};
@@ -23,11 +19,11 @@ const SendButton: React.FC = () => {
return (
);
};
diff --git a/web/app/_components/SimpleTextMessage/index.tsx b/web/app/_components/SimpleTextMessage/index.tsx
index bb1690f2a..4ccf2f22c 100644
--- a/web/app/_components/SimpleTextMessage/index.tsx
+++ b/web/app/_components/SimpleTextMessage/index.tsx
@@ -4,6 +4,7 @@ import { TextCode } from "../TextCode";
import { getMessageCode } from "@/_utils/message";
import Image from "next/image";
import { MessageSenderType } from "@/_models/ChatMessage";
+import LoadingIndicator from "../LoadingIndicator";
type Props = {
avatarUrl: string;
@@ -13,6 +14,17 @@ type Props = {
text?: string;
};
+const renderMessageCode = (text: string) => {
+ return getMessageCode(text).map((item, i) => (
+
+
+ {item.text}
+
+ {item.code.trim().length > 0 &&
}
+
+ ));
+};
+
const SimpleTextMessage: React.FC
= ({
senderName,
createdAt,
@@ -25,7 +37,7 @@ const SimpleTextMessage: React.FC = ({
return (
= ({
{displayDate(createdAt)}
- {text.includes("```") ? (
- getMessageCode(text).map((item, i) => (
-
-
- {item.text}
-
- {item.code.trim().length > 0 &&
}
-
- ))
+ {text === "" ? (
+
+ ) : text.includes("```") ? (
+ renderMessageCode(text)
) : (
{text}
)}