Spaces:
Sleeping
Sleeping
Download web/src/components/chat/Message.tsx from TBM99/CoverageCheck: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/spaces/TBM99/CoverageCheck/resolve/main/web/src/components/chat/Message.tsx
- Command line
-
hf download hf://spaces/TBM99/CoverageCheck/web/src/components/chat/Message.tsx
-
curl -L -o Message.tsx https://huggingface.co/spaces/TBM99/CoverageCheck/resolve/main/web/src/components/chat/Message.tsx
1.1 kB
| import type { Turn } from '@/hooks/useChat' | |
| import { AnswerBody } from './AnswerBody' | |
| /** One turn of the conversation: the question (right, with how a follow-up was | |
| * understood), then the answer (AnswerBody, shared with the Evals page's examples). */ | |
| export function Message({ turn }: { turn: Turn }) { | |
| const { run } = turn | |
| return ( | |
| <div className="space-y-4"> | |
| <div className="flex flex-col items-end gap-1"> | |
| <div className="max-w-[85%] rounded-2xl rounded-br-md bg-primary px-4 py-2.5 text-[15px] whitespace-pre-wrap text-primary-foreground"> | |
| {turn.question} | |
| </div> | |
| {run.rewrite?.changed && ( | |
| <p className="max-w-[85%] text-right text-xs text-muted-foreground"> | |
| Understood as: <span className="text-foreground/80 italic">{run.rewrite.question}</span> | |
| </p> | |
| )} | |
| <span className="text-[11px] text-muted-foreground"> | |
| System {turn.system.toUpperCase()} · policy date {turn.day ?? 'today'} | |
| </span> | |
| </div> | |
| <AnswerBody run={run} lastEventAt={turn.lastEventAt} /> | |
| </div> | |
| ) | |
| } | |