File size: 560 Bytes
a2b51e3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
type MessageType = "user" | "assistant";

interface ChatMessageProps {
  type: MessageType;
  content: string;
}

export default function ChatMessage({ type, content }: ChatMessageProps) {
  return (
    <div
      className={`flex ${
        type === "user" ? "justify-end" : "justify-start"
      } mb-4`}
    >
      <div
        className={`max-w-[80%] rounded-lg px-4 py-2 ${
          type === "user"
            ? "bg-blue-500 text-white"
            : "bg-gray-100 dark:bg-gray-800"
        }`}
      >
        {content}
      </div>
    </div>
  );
}