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 } - > + /> ); - }), + }, ); -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';