import React from 'react'; import { ChatMessage as ChatMessageType } from '../types'; interface ChatMessageProps { message: ChatMessageType; } const ChatMessage: React.FC = ({ message }) => { const isUser = message.sender === 'user'; const bubbleClasses = isUser ? 'bg-blue-500 text-white self-end rounded-br-none' : 'bg-white text-gray-800 self-start rounded-bl-none'; const containerClasses = isUser ? 'justify-end' : 'justify-start'; // Basic markdown to HTML conversion for bold and newlines const formatText = (text: string) => { return text .replace(/\*\*(.*?)\*\*/g, '$1') .replace(/\n/g, '
'); }; return (

); }; export default ChatMessage;