Spaces:
Paused
Paused
Download components/ChatMessage.jsx from durukan/anycoder-82c661ce: direct link, hf CLI and curl.
- Browser
- Download file 570 Bytes
-
https://huggingface.co/spaces/durukan/anycoder-82c661ce/resolve/main/components/ChatMessage.jsx
- Command line
-
hf download hf://spaces/durukan/anycoder-82c661ce/components/ChatMessage.jsx
-
curl -L -o ChatMessage.jsx https://huggingface.co/spaces/durukan/anycoder-82c661ce/resolve/main/components/ChatMessage.jsx
570 Bytes
| import { format } from 'date-fns'; | |
| export default function ChatMessage({ message, isUser }) { | |
| return ( | |
| <div className={`flex ${isUser ? 'justify-end' : 'justify-start'} mb-4`}> | |
| <div className={`max-w-xs md:max-w-md lg:max-w-lg xl:max-w-xl rounded-lg p-3 ${isUser ? 'bg-primary text-white rounded-br-none' : 'bg-gray-100 text-gray-800 rounded-bl-none'}`}> | |
| <p className="mb-1">{message.text}</p> | |
| <p className="text-xs opacity-70 text-right"> | |
| {format(new Date(message.timestamp), 'h:mm a')} | |
| </p> | |
| </div> | |
| </div> | |
| ); | |
| } |