Download react-query/examples/react/chat/src/message.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 526 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/react/chat/src/message.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/react/chat/src/message.tsx
-
curl -L -o message.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/react/chat/src/message.tsx
526 Bytes
| export function Message({ | |
| inProgress, | |
| message, | |
| }: { | |
| inProgress?: boolean | |
| message: { content: string; isQuestion: boolean } | |
| }) { | |
| return ( | |
| <div | |
| className={`flex ${message.isQuestion ? 'justify-end' : 'justify-start'}`} | |
| > | |
| <div | |
| className={`max-w-[80%] rounded-lg p-3 ${ | |
| message.isQuestion | |
| ? 'bg-blue-500 text-white' | |
| : 'bg-gray-200 text-gray-800' | |
| }`} | |
| > | |
| {message.content} | |
| {inProgress ? '...' : null} | |
| </div> | |
| </div> | |
| ) | |
| } | |