diff --git a/components/chat/floating-chat.tsx b/components/chat/floating-chat.tsx index 032b97d..6fd7f8b 100644 --- a/components/chat/floating-chat.tsx +++ b/components/chat/floating-chat.tsx @@ -536,38 +536,48 @@ export default function FloatingChat() { {!isMinimized && ( <> - {/* Chat History Panel */} - {showHistory && ( - - - - Chat History - - - - - - setShowHistory(false)} - title="Close History" - > - - + {/* Main Content Area - Side by Side Layout */} + + {/* Chat History Panel - Left Side */} + {showHistory && ( + + + + + Chat History + + + + + + setShowHistory(false)} + title="Close History" + > + + + + - + + {!isAuthenticated ? ( @@ -638,8 +648,242 @@ export default function FloatingChat() { ))} )} + + + )} + + {/* Main Chat Area - Right Side */} + + {/* Suggested Questions */} + + + {t('suggestions.title')} + + + {suggestedQuestions.slice(0, 3).map((question, index) => ( + setInputMessage(question)} + sx={{ + fontSize: '0.75rem', + cursor: 'pointer', + '&:hover': { + bgcolor: 'primary.light', + color: 'white', + }, + }} + /> + ))} + + + + {/* Messages */} + + {messages.map((message) => ( + + + + {message.role === 'user' ? : } + + + + {message.role === 'assistant' ? ( + ( + + {children} + + ), + h3: ({ children }) => ( + + {children} + + ), + strong: ({ children }) => ( + + {children} + + ), + ul: ({ children }) => ( + + {children} + + ), + li: ({ children }) => ( + + {children} + + ), + }} + > + {message.content} + + ) : ( + + {message.content} + + )} + + {message.role === 'assistant' && ( + + copyToClipboard(message.content)} + > + + + + + + + + + + )} + + + {message.timestamp.toLocaleTimeString(locale === 'en' ? 'en-US' : 'ro-RO', { + hour: '2-digit', + minute: '2-digit', + })} + + + + + ))} + + {isLoading && ( + + + + + + + + {t('loading')} + + + + + )} + +
+ + + + + {/* Input */} + + + setInputMessage(e.target.value)} + onKeyPress={handleKeyPress} + disabled={isLoading} + variant="outlined" + sx={{ + '& .MuiOutlinedInput-root': { + borderRadius: 2, + } + }} + /> + + + + {t('enterToSend')} + + - )} + {/* Conversation Menu */} - - {/* Suggested Questions */} - - - {t('suggestions.title')} - - - {suggestedQuestions.slice(0, 3).map((question, index) => ( - setInputMessage(question)} - sx={{ - fontSize: '0.75rem', - cursor: 'pointer', - '&:hover': { - bgcolor: 'primary.light', - color: 'white', - }, - }} - /> - ))} - - - - {/* Messages */} - - {messages.map((message) => ( - - - - {message.role === 'user' ? : } - - - - {message.role === 'assistant' ? ( - ( - - {children} - - ), - h3: ({ children }) => ( - - {children} - - ), - strong: ({ children }) => ( - - {children} - - ), - ul: ({ children }) => ( - - {children} - - ), - li: ({ children }) => ( - - {children} - - ), - }} - > - {message.content} - - ) : ( - - {message.content} - - )} - - {message.role === 'assistant' && ( - - copyToClipboard(message.content)} - > - - - - - - - - - - )} - - - {message.timestamp.toLocaleTimeString(locale === 'en' ? 'en-US' : 'ro-RO', { - hour: '2-digit', - minute: '2-digit', - })} - - - - - ))} - - {isLoading && ( - - - - - - - - {t('loading')} - - - - - )} - -
- - - - - {/* Input */} - - - setInputMessage(e.target.value)} - onKeyPress={handleKeyPress} - disabled={isLoading} - variant="outlined" - sx={{ - '& .MuiOutlinedInput-root': { - borderRadius: 2, - } - }} - /> - - - - {t('enterToSend')} - - )}