import { createStyles } from 'antd-style'; import { ChatMessage } from './ChatMessage'; import { WelcomeScreen } from './WelcomeScreen'; import { ChatInput } from './ChatInput'; import type { Message } from '../types'; const useStyles = createStyles(({ css }) => ({ container: css` flex: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; `, messagesWrapper: css` flex: 1; overflow-y: auto; overflow-x: hidden; padding: 24px; &::-webkit-scrollbar { width: 8px; } &::-webkit-scrollbar-track { background: transparent; } &::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 4px; } &::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); } `, messages: css` max-width: 52rem; margin: 0 auto; width: 100%; `, inputArea: css` padding: 24px; background: rgba(17, 17, 17, 0.7); backdrop-filter: blur(20px); border-top: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.6); `, inputContainer: css` max-width: 52rem; margin: 0 auto; `, disclaimer: css` text-align: center; font-size: 12px; color: rgba(255, 255, 255, 0.45); margin-top: 16px; `, })); interface ChatContainerProps { messages: Message[]; isTyping: boolean; onSendMessage: (content: string) => void; } export const ChatContainer: React.FC = ({ messages, isTyping, onSendMessage, }) => { const { styles } = useStyles(); const handleSend = (content: string) => { if (content.trim()) { onSendMessage(content); } }; return (
{messages.length === 0 ? ( ) : ( <> {messages.map((message) => ( ))} {isTyping && ( )} )}
Nexus puede cometer errores. Considera verificar información importante.
); };