Spaces:
Paused
Paused
Download client/src/components/Collab/CollabChatMessageText.tsx from Leon4gr45/augmenttoolkit: direct link, hf CLI and curl.
- Browser
- Download file 641 Bytes
-
https://huggingface.co/spaces/Leon4gr45/augmenttoolkit/resolve/bb4da7e5d448e08c0375f8cfd152cb4fdc024f92/client/src/components/Collab/CollabChatMessageText.tsx
- Command line
-
hf download hf://spaces/Leon4gr45/augmenttoolkit@bb4da7e5d448e08c0375f8cfd152cb4fdc024f92/client/src/components/Collab/CollabChatMessageText.tsx
-
curl -L -o CollabChatMessageText.tsx https://huggingface.co/spaces/Leon4gr45/augmenttoolkit/resolve/bb4da7e5d448e08c0375f8cfd152cb4fdc024f92/client/src/components/Collab/CollabChatMessageText.tsx
641 Bytes
| import { URL_REGEX } from './CollabChat.constants' | |
| /* ── Message Text with clickable URLs ── */ | |
| interface MessageTextProps { | |
| text: string | |
| } | |
| export function MessageText({ text }: MessageTextProps) { | |
| const parts = text.split(URL_REGEX) | |
| const urls = text.match(URL_REGEX) || [] | |
| const result = [] | |
| parts.forEach((part, i) => { | |
| if (part) result.push(part) | |
| if (urls[i]) result.push( | |
| <a key={i} href={urls[i]} target="_blank" rel="noopener noreferrer" style={{ color: 'inherit', textDecoration: 'underline', textUnderlineOffset: 2, opacity: 0.85 }}> | |
| {urls[i]} | |
| </a> | |
| ) | |
| }) | |
| return <>{result}</> | |
| } | |