diff --git a/client/src/components/Chat/Input/CallButton.tsx b/client/src/components/Chat/Input/CallButton.tsx
new file mode 100644
index 0000000000..e8a1f11d65
--- /dev/null
+++ b/client/src/components/Chat/Input/CallButton.tsx
@@ -0,0 +1,40 @@
+import React, { forwardRef } from 'react';
+import { TooltipAnchor } from '~/components/ui';
+import { SendIcon } from '~/components/svg';
+import { useLocalize } from '~/hooks';
+import { cn } from '~/utils';
+
+const Button = React.memo(
+ forwardRef((props: { disabled: boolean }) => {
+ const localize = useLocalize();
+ return (
+
+
+
+
+
+ }
+ >
+ );
+ }),
+);
+
+const CallButton = React.memo(
+ forwardRef((props: { disabled: boolean }) => {
+ return ;
+ }),
+);
+
+export default CallButton;
diff --git a/client/src/components/Chat/Input/ChatForm.tsx b/client/src/components/Chat/Input/ChatForm.tsx
index 442d32a45e..625965282e 100644
--- a/client/src/components/Chat/Input/ChatForm.tsx
+++ b/client/src/components/Chat/Input/ChatForm.tsx
@@ -1,3 +1,4 @@
+import { useWatch } from 'react-hook-form';
import { memo, useRef, useMemo, useEffect, useState } from 'react';
import { useRecoilState, useRecoilValue } from 'recoil';
import {
@@ -31,6 +32,7 @@ import AudioRecorder from './AudioRecorder';
import { mainTextareaId } from '~/common';
import CollapseChat from './CollapseChat';
import StreamAudio from './StreamAudio';
+import CallButton from './CallButton';
import StopButton from './StopButton';
import SendButton from './SendButton';
import Mention from './Mention';
diff --git a/client/src/components/Chat/Input/SendButton.tsx b/client/src/components/Chat/Input/SendButton.tsx
index 870d62d312..c925b8c14a 100644
--- a/client/src/components/Chat/Input/SendButton.tsx
+++ b/client/src/components/Chat/Input/SendButton.tsx
@@ -1,49 +1,71 @@
import React, { forwardRef } from 'react';
import { useWatch } from 'react-hook-form';
import type { Control } from 'react-hook-form';
-import { TooltipAnchor } from '~/components/ui';
-import { SendIcon } from '~/components/svg';
+import { TooltipAnchor, SendIcon, CallIcon } from '~/components';
import { useLocalize } from '~/hooks';
import { cn } from '~/utils';
-type SendButtonProps = {
+type ButtonProps = {
disabled: boolean;
control: Control<{ text: string }>;
};
-const SubmitButton = React.memo(
- forwardRef((props: { disabled: boolean }, ref: React.ForwardedRef) => {
- const localize = useLocalize();
+const ActionButton = forwardRef(
+ (
+ props: {
+ disabled: boolean;
+ icon: React.ReactNode;
+ tooltip: string;
+ testId: string;
+ },
+ ref: React.ForwardedRef,
+ ) => {
return (
-
+ {props.icon}
}
- >
+ />
);
- }),
+ },
);
-const SendButton = React.memo(
- forwardRef((props: SendButtonProps, ref: React.ForwardedRef) => {
- const data = useWatch({ control: props.control });
- return ;
- }),
-);
+const SendButton = forwardRef((props: ButtonProps, ref: React.ForwardedRef) => {
+ const localize = useLocalize();
+ const { text } = useWatch({ control: props.control });
+
+ const buttonProps = text
+ ? {
+ icon: ,
+ tooltip: localize('com_nav_send_message'),
+ testId: 'send-button',
+ }
+ : {
+ icon: ,
+ tooltip: localize('com_nav_call'),
+ testId: 'call-button',
+ };
+
+ return ;
+});
+
+SendButton.displayName = 'SendButton';
export default SendButton;
diff --git a/client/src/components/svg/CallIcon.tsx b/client/src/components/svg/CallIcon.tsx
new file mode 100644
index 0000000000..b493a67747
--- /dev/null
+++ b/client/src/components/svg/CallIcon.tsx
@@ -0,0 +1,30 @@
+import { cn } from '~/utils';
+
+export default function CallIcon({ size = 24, className = '' }) {
+ return (
+
+ );
+}
diff --git a/client/src/components/svg/index.ts b/client/src/components/svg/index.ts
index 745c5210bd..c430e65052 100644
--- a/client/src/components/svg/index.ts
+++ b/client/src/components/svg/index.ts
@@ -56,3 +56,4 @@ export { default as SpeechIcon } from './SpeechIcon';
export { default as SaveIcon } from './SaveIcon';
export { default as CircleHelpIcon } from './CircleHelpIcon';
export { default as BedrockIcon } from './BedrockIcon';
+export { default as CallIcon } from './CallIcon';