Skip to content

Commit

Permalink
chore: remove the continue button
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwisecodes committed Nov 13, 2024
1 parent 26f3802 commit f9b83ed
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const QuickActionButtons = ({ isEmptyScreen }: QuickActionButtonsProps) => {
</ChatButton>
)}
</div>
<ChatButton
{/* <ChatButton
size="sm"
variant="primary"
disabled={!shouldAllowUserAction}
Expand All @@ -135,7 +135,7 @@ const QuickActionButtons = ({ isEmptyScreen }: QuickActionButtonsProps) => {
testId="chat-continue"
>
Continue
</ChatButton>
</ChatButton> */}
</div>
);
};
Expand Down
52 changes: 52 additions & 0 deletions apps/nextjs/src/components/AppComponents/Chat/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="flex flex-col gap-5">
<p className={cn("mb-7 last:mb-0", className)}>{text}</p>
<InLineButton
onClick={() =>
append({
content: "Proceed to the next step",
role: "user",
})
}
text="Proceed to the next step"
/>
</div>
);
}
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 (
<div className="flex flex-col gap-5">
<p className={cn("mb-7 last:mb-0", className)}>{text}</p>
<InLineButton
onClick={() =>
append({
content: "Proceed to the final step",
role: "user",
})
}
text="Proceed to the final step"
/>
</div>
);
}
if (
Array.isArray(children) &&
children[2].includes("start from scratch")
Expand Down

0 comments on commit f9b83ed

Please sign in to comment.