Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

Add ScrollToBottomButton and related props to Footer component

Salman-Ahamed62af17cefc70
diff --git a/packages/app/src/react/features/ai-chat/components/footer.tsx b/packages/app/src/react/features/ai-chat/components/footer.tsx
index a64ed750..d601afbf 100644
--- a/packages/app/src/react/features/ai-chat/components/footer.tsx
+++ b/packages/app/src/react/features/ai-chat/components/footer.tsx
@@ -1,7 +1,8 @@
import {
ChatInput,
- ErrorToast,
ChatInputRef,
+ ErrorToast,
+ ScrollToBottomButton,
WarningInfo,
} from '@react/features/ai-chat/components';
import { FC, RefObject } from 'react';
@@ -11,18 +12,30 @@ interface FooterProps {
clearError: () => void;
chatInputRef: RefObject<ChatInputRef>;
submitDisabled: boolean;
+ showScrollButton: boolean;
+ scrollToBottom: (smooth?: boolean) => void; // eslint-disable-line no-unused-vars
}
const CHAT_WARNING_INFO =
"SmythOS can make mistakes, always check your work. We don't store chat history, save important work."; // eslint-disable-line quotes
export const Footer: FC<FooterProps> = (props) => {
- const { uploadError, clearError, chatInputRef, submitDisabled } = props;
+ const {
+ uploadError,
+ clearError,
+ chatInputRef,
+ submitDisabled,
+ showScrollButton,
+ scrollToBottom,
+ } = props;
return (
<div className="w-full max-w-4xl">
{uploadError.show && <ErrorToast message={uploadError.message} onClose={clearError} />}
- <ChatInput ref={chatInputRef} submitDisabled={submitDisabled} />
+ <div className="relative">
+ {showScrollButton && <ScrollToBottomButton onClick={() => scrollToBottom(true)} />}
+ <ChatInput ref={chatInputRef} submitDisabled={submitDisabled} />
+ </div>
<WarningInfo infoMessage={CHAT_WARNING_INFO} />
</div>
);