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.

Enhance SendButton component with dynamic class handling and improved props management. Added utility function for class name concatenation and ensured proper handling of disabled state.

Salman-Ahamed9c6402e06cb5
diff --git a/packages/app/src/react/features/ai-chat/components/send-button.tsx b/packages/app/src/react/features/ai-chat/components/send-button.tsx
index 052e105e..5a32524f 100644
--- a/packages/app/src/react/features/ai-chat/components/send-button.tsx
+++ b/packages/app/src/react/features/ai-chat/components/send-button.tsx
@@ -2,6 +2,7 @@ import { FC } from 'react';
import { FaStop } from 'react-icons/fa6';
import { Button } from '@react/shared/components/ui/newDesign/button';
+import { cn } from '@src/react/shared/utils/general';
interface SendButtonProps {
isProcessing: boolean;
@@ -11,9 +12,14 @@ interface SendButtonProps {
export const SendButton: FC<SendButtonProps> = ({ isProcessing, disabled, onClick }) => (
<Button
+ addIcon
variant="primary"
+ disabled={disabled}
handleClick={onClick}
- addIcon
+ className={cn(
+ 'h-[40px] w-[40px] rounded-lg px-0 py-0',
+ isProcessing ? 'chat-stop' : 'chat-send',
+ )}
Icon={
isProcessing ? (
<FaStop fontSize={14} />
@@ -34,7 +40,5 @@ export const SendButton: FC<SendButtonProps> = ({ isProcessing, disabled, onClic
</svg>
)
}
- className="h-[40px] w-[40px] rounded-lg px-0 py-0"
- disabled={disabled}
/>
);