From f9b83ed6fac5700d72fbfb32aa8875177525ae38 Mon Sep 17 00:00:00 2001
From: Tom Wise <79859203+tomwisecodes@users.noreply.github.com>
Date: Wed, 13 Nov 2024 15:29:44 +0000
Subject: [PATCH] chore: remove the continue button
---
.../AppComponents/Chat/chat-quick-buttons.tsx | 4 +-
.../AppComponents/Chat/markdown.tsx | 52 +++++++++++++++++++
2 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-quick-buttons.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-quick-buttons.tsx
index 3226fc83d..68dbcc756 100644
--- a/apps/nextjs/src/components/AppComponents/Chat/chat-quick-buttons.tsx
+++ b/apps/nextjs/src/components/AppComponents/Chat/chat-quick-buttons.tsx
@@ -125,7 +125,7 @@ const QuickActionButtons = ({ isEmptyScreen }: QuickActionButtonsProps) => {
)}
- {
testId="chat-continue"
>
Continue
-
+ */}
);
};
diff --git a/apps/nextjs/src/components/AppComponents/Chat/markdown.tsx b/apps/nextjs/src/components/AppComponents/Chat/markdown.tsx
index fdd954e1a..f17ed38e8 100644
--- a/apps/nextjs/src/components/AppComponents/Chat/markdown.tsx
+++ b/apps/nextjs/src/components/AppComponents/Chat/markdown.tsx
@@ -74,6 +74,58 @@ export const MemoizedReactMarkdownWithStyles = ({
);
},
p({ children }) {
+ if (
+ Array.isArray(children) &&
+ (children[children.length - 1]?.includes(
+ "proceed to the next step",
+ ) ||
+ children[children.length - 1]?.includes(
+ " move on to the next step",
+ ))
+ ) {
+ const text = children.slice(0, -2)[0].split("Otherwise, tap")[0];
+
+ return (
+
+
{text}
+
+ append({
+ content: "Proceed to the next step",
+ role: "user",
+ })
+ }
+ text="Proceed to the next step"
+ />
+
+ );
+ }
+ if (
+ Array.isArray(children) &&
+ (children[children.length - 1]?.includes(
+ "proceed to the final step",
+ ) ||
+ children[children.length - 1]?.includes(
+ " move on to the final step",
+ ))
+ ) {
+ const text = children.slice(0, -2)[0].split("Otherwise, tap")[0];
+
+ return (
+
+
{text}
+
+ append({
+ content: "Proceed to the final step",
+ role: "user",
+ })
+ }
+ text="Proceed to the final step"
+ />
+
+ );
+ }
if (
Array.isArray(children) &&
children[2].includes("start from scratch")