11import React , { useState , FormEvent , useRef , useEffect } from 'react' ;
22import { Conversation , Message } from '../../types/chat' ;
33import { MCPServerSettings } from '../../types/settings' ;
4- import { Send , Square , Copy , Pencil , Loader2 , Globe , RefreshCw , Check , X , ServerCog } from 'lucide-react' ;
4+ import { Send , Square , Copy , Pencil , Loader2 , Globe , RefreshCw , Check , X ,
5+ // ServerCog
6+ } from 'lucide-react' ;
57import MarkdownContent from './MarkdownContent' ;
68import MessageToolboxMenu , { ToolboxAction } from '../ui/MessageToolboxMenu' ;
79import { MessageHelper } from '../../services/message-helper' ;
@@ -13,7 +15,7 @@ import ProviderIcon from '../ui/ProviderIcon';
1315import { useTranslation } from '../../hooks/useTranslation' ;
1416import FileUploadButton from './FileUploadButton' ;
1517import FileAttachmentDisplay from './FileAttachmentDisplay' ;
16- import ImageGenerationButton from './ImageGenerationButton' ;
18+ // import ImageGenerationButton from './ImageGenerationButton';
1719
1820interface ChatMessageAreaProps {
1921 activeConversation : Conversation | null ;
@@ -44,9 +46,9 @@ export const ChatMessageArea: React.FC<ChatMessageAreaProps> = ({
4446 isCurrentlyStreaming = false ,
4547 selectedProvider,
4648 selectedModel,
47- mcpServers,
48- selectedMcpServers,
49- onToggleMcpServer,
49+ // mcpServers,
50+ // selectedMcpServers,
51+ // onToggleMcpServer,
5052} ) => {
5153 const { t } = useTranslation ( ) ;
5254 const [ inputValue , setInput ] = useState ( '' ) ;
@@ -61,9 +63,9 @@ export const ChatMessageArea: React.FC<ChatMessageAreaProps> = ({
6163 const [ webSearchActive , setWebSearchActive ] = useState ( false ) ;
6264 const [ isWebSearchPreviewEnabled , setIsWebSearchPreviewEnabled ] = useState ( false ) ;
6365 const [ selectedFiles , setSelectedFiles ] = useState < File [ ] > ( [ ] ) ;
64- const [ mcpPopupOpen , setMcpPopupOpen ] = useState ( false ) ;
65- const mcpButtonRef = useRef < HTMLButtonElement > ( null ) ;
66- const mcpPopupRef = useRef < HTMLDivElement > ( null ) ;
66+ // const [mcpPopupOpen, setMcpPopupOpen] = useState(false);
67+ // const mcpButtonRef = useRef<HTMLButtonElement>(null);
68+ // const mcpPopupRef = useRef<HTMLDivElement>(null);
6769
6870 // Scroll to bottom when messages change
6971 useEffect ( ( ) => {
@@ -291,23 +293,23 @@ export const ChatMessageArea: React.FC<ChatMessageAreaProps> = ({
291293 }
292294
293295 // Add useEffect to handle click outside for MCP popup
294- useEffect ( ( ) => {
295- const handleClickOutside = ( event : MouseEvent ) => {
296- if (
297- mcpPopupRef . current &&
298- ! mcpPopupRef . current . contains ( event . target as Node ) &&
299- mcpButtonRef . current &&
300- ! mcpButtonRef . current . contains ( event . target as Node )
301- ) {
302- setMcpPopupOpen ( false ) ;
303- }
304- } ;
305-
306- document . addEventListener ( 'mousedown' , handleClickOutside ) ;
307- return ( ) => {
308- document . removeEventListener ( 'mousedown' , handleClickOutside ) ;
309- } ;
310- } , [ ] ) ;
296+ // useEffect(() => {
297+ // const handleClickOutside = (event: MouseEvent) => {
298+ // if (
299+ // mcpPopupRef.current &&
300+ // !mcpPopupRef.current.contains(event.target as Node) &&
301+ // mcpButtonRef.current &&
302+ // !mcpButtonRef.current.contains(event.target as Node)
303+ // ) {
304+ // setMcpPopupOpen(false);
305+ // }
306+ // };
307+
308+ // document.addEventListener('mousedown', handleClickOutside);
309+ // return () => {
310+ // document.removeEventListener('mousedown', handleClickOutside);
311+ // };
312+ // }, []);
311313
312314 // If no active conversation is selected
313315 if ( ! activeConversation ) {
@@ -566,7 +568,7 @@ export const ChatMessageArea: React.FC<ChatMessageAreaProps> = ({
566568 ) }
567569
568570 { /* Image generation button */ }
569- < ImageGenerationButton
571+ { /* <ImageGenerationButton
570572 disabled={isLoading || isCurrentlyStreaming}
571573 onImageGenerate={(prompt, provider, model) => {
572574 // Set special message for image generation
@@ -575,7 +577,7 @@ export const ChatMessageArea: React.FC<ChatMessageAreaProps> = ({
575577 // Focus the input
576578 inputRef.current?.focus();
577579 }}
578- />
580+ /> */ }
579581 </ div >
580582
581583 { /* Web search element */ }
@@ -584,7 +586,7 @@ export const ChatMessageArea: React.FC<ChatMessageAreaProps> = ({
584586 }
585587
586588 { /* MCP Servers dropdown */ }
587- { mcpServers && Object . keys ( mcpServers ) . length > 0 && (
589+ { /* { mcpServers && Object.keys(mcpServers).length > 0 && (
588590 <div className="relative">
589591 <button
590592 type="button"
@@ -645,7 +647,7 @@ export const ChatMessageArea: React.FC<ChatMessageAreaProps> = ({
645647 </div>
646648 )}
647649 </div>
648- ) }
650+ )} */ }
649651
650652 < span className = { `flex-1 hidden text-xs text-center pt-4 text-gray-300 md:block truncate pr-6 lg:pr-12` } >
651653 { t ( 'chat.pressShiftEnterToChangeLines' ) }
0 commit comments