diff --git a/web-app/src/containers/ChatInput.tsx b/web-app/src/containers/ChatInput.tsx index 1ed69df96..24b1bf57c 100644 --- a/web-app/src/containers/ChatInput.tsx +++ b/web-app/src/containers/ChatInput.tsx @@ -16,6 +16,7 @@ import { IconCodeCircle2, IconPlayerStopFilled, IconBrandSpeedtest, + IconX, } from '@tabler/icons-react' import { useTranslation } from 'react-i18next' import { useGeneralSetting } from '@/hooks/useGeneralSetting' @@ -56,8 +57,16 @@ const ChatInput = ({ const { selectedModel } = useModelProvider() const { sendMessage } = useChat() + const [message, setMessage] = useState('') - console.log(model) + const handleSendMesage = (prompt: string) => { + if (!selectedModel) { + setMessage('Please select a model to start chatting.') + return + } + setMessage('') + sendMessage(prompt) + } useEffect(() => { const handleFocusIn = () => { @@ -130,154 +139,173 @@ const ChatInput = ({ return (