+
+
Documentation assistant
+
+
+
+ {messages.map((message) => (
+
+
+ {message.role === 'user' ? (
+
{message.content}
+ ) : (
+
+
{
+ const match = /language-(\w+)/.exec(className || '');
+ const language = match ? match[1] : undefined;
+
+ // Handle suggestions code block
+ if (language === 'suggestions' && typeof children === 'string') {
+ const links = parseSuggestionLinks(children, docsURL);
+ return (
+
+ );
+ }
+
+ // Fallback to default code rendering
+ return (
+
+ {children}
+
+ );
+ }
+ }}
+ >
+ {message.content}
+
+
+ )}
+
+
+ ))}
+
+ {isLoading &&
Loading...
}
+
+
+
+
+ )}
+ >
+ );
+}
+```
+
+