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( {urls[i]} ) }) return <>{result} }