File size: 762 Bytes
5feba25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
const MessageBubble = ({ role, content }) => {
  if (role === 'user') {
    return (
      <div className="flex justify-end mb-4">
        <div className="bg-white border border-gray-200 rounded-xl shadow-sm px-4 py-3 max-w-prose hover:shadow-md transition-shadow">
          <p className="text-gray-900 text-sm leading-relaxed whitespace-pre-wrap break-words">
            {content}
          </p>
        </div>
      </div>
    )
  }

  return (
    <div className="flex justify-start mb-4">
      <div className="bg-[#FFD1DC] rounded-xl px-4 py-3 max-w-prose shadow-sm">
        <p className="text-gray-900 text-sm leading-relaxed whitespace-pre-wrap break-words">
          {content}
        </p>
      </div>
    </div>
  )
}

export default MessageBubble