Spaces:
Running
Running
Download frontend/src/components/ChatBubble.jsx from Agmmm/valhalla: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/spaces/Agmmm/valhalla/resolve/main/frontend/src/components/ChatBubble.jsx
- Command line
-
hf download hf://spaces/Agmmm/valhalla/frontend/src/components/ChatBubble.jsx
-
curl -L -o ChatBubble.jsx https://huggingface.co/spaces/Agmmm/valhalla/resolve/main/frontend/src/components/ChatBubble.jsx
1.08 kB
| /** | |
| * ChatBubble — a single message bubble in a conversation transcript. | |
| * | |
| * Aligns right for the focused agent (self) and left for the partner, | |
| * colored by the speaker's agent color. | |
| * | |
| * Architecture: rendered by ChatPanel for each revealed message. | |
| * | |
| * Design: purely presentational; no state. | |
| */ | |
| export default function ChatBubble({ text, isSelf, color }) { | |
| return ( | |
| <div style={{ | |
| display: "flex", | |
| justifyContent: isSelf ? "flex-end" : "flex-start", | |
| marginBottom: 4, | |
| animation: "fadeIn 0.2s ease-out", | |
| }}> | |
| <div style={{ | |
| maxWidth: "80%", | |
| padding: "5px 9px", | |
| borderRadius: 8, | |
| borderBottomRightRadius: isSelf ? 2 : 8, | |
| borderBottomLeftRadius: isSelf ? 8 : 2, | |
| background: isSelf ? color : "rgba(255,255,255,0.06)", | |
| color: isSelf ? "#09090e" : "#d0d0da", | |
| fontSize: 11, | |
| lineHeight: 1.35, | |
| wordBreak: "break-word", | |
| fontFamily: "'Outfit', sans-serif", | |
| fontWeight: isSelf ? 500 : 400, | |
| }}> | |
| {text} | |
| </div> | |
| </div> | |
| ); | |
| } | |