From 397e385a02d266c0734fb20bc2e69fbcf5890de2 Mon Sep 17 00:00:00 2001 From: Swapnoneel Saha Date: Fri, 11 Oct 2024 01:42:01 +0530 Subject: [PATCH] handled edge cases and fixed responsiveness Signed-off-by: Swapnoneel Saha --- src/components/ChatBot.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/ChatBot.js b/src/components/ChatBot.js index 5905bdca8..aa0c3b99f 100644 --- a/src/components/ChatBot.js +++ b/src/components/ChatBot.js @@ -35,6 +35,15 @@ function textFormat(text) { } else if (text.substring(i, i + 1) == "#") { heading = 1; output += `\n\n`; + } else if (text.substring(i, i + 1) == "]") { + output += ": "; + } else if (text.substring(i, i + 1) == "[") { + output += ""; + } else if ( + text.substring(i, i + 1) == "(" || + text.substring(i, i + 1) == ")" + ) { + output += `"`; } else if (text.substring(i, i + 1) == "<") { i++; while ( @@ -137,7 +146,7 @@ export default function ChatBot() { }, []); return ( -
+
{!isOpen && (
-
+
- {isLoading ? "Sending..." : "Send"} + {isLoading ? "Sent" : "Send"}