import React from "react"; export function FormattedText({ text }: { text: string }) { const lines = text.split('\n'); const urlRegex = /(https?:\/\/[^\s]+)/g; return ( <> {lines.map((line, i) => { const parts = line.split(urlRegex); return ( {i > 0 &&
} {parts.map((part, j) => { if (part.match(urlRegex)) { return ( e.stopPropagation()} > {part} ); } return part; })}
); })} ); }