Newer
Older
cortex-hub / ui / tts-client-app / src / components / ChatWindow.js
// src/components/ChatWindow.js
import React from "react";

const ChatWindow = ({ chatHistory }) => {
  return (
    <div className="space-y-4">
      {chatHistory.map((message, index) => (
        <div
          key={index}
          className={`flex ${
            message.isUser ? "justify-end" : "justify-start"
          }`}
        >
          <div
            className={`max-w-md p-4 rounded-lg shadow-md ${
              message.isUser
                ? "bg-indigo-500 text-white"
                : "bg-gray-200 dark:bg-gray-700 text-gray-900 dark:text-gray-100"
            }`}
          >
            <p>{message.text}</p>
          </div>
        </div>
      ))}
    </div>
  );
};

export default ChatWindow;