diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index f47c829..731e9c3 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -13,7 +13,7 @@ import Avatar from '@cloudscape-design/chat-components/avatar'; import SupportPromptGroup from '@cloudscape-design/chat-components/support-prompt-group'; import PromptInput from '@cloudscape-design/components/prompt-input'; import Alert from '@cloudscape-design/components/alert'; -import ReactMarkdown from 'react-markdown'; +import ReactMarkdown, { Components } from 'react-markdown'; import remarkGfm from 'remark-gfm'; import { invokeAgent } from './agentcore'; import './markdown.css'; @@ -433,64 +433,66 @@ function App() { ariaLabel={`${message.type === 'user' ? 'User' : 'Generative AI assistant'} message`} avatar={message.type === 'user' ?
: undefined} > -
- {children}
-
- ) : (
-
-
+
+ {
+ const inline = !className;
+ return inline ? (
+
{children}
-
- );
- },
- // Style links
- a: ({ children, href }: any) => (
-
- {children}
-
- ),
- // Style lists
- ul: ({ children }: any) => (
-
- {children}
-
- ),
- ol: ({ children }: any) => (
-
- {children}
-
- ),
- // Style paragraphs
- p: ({ children }: any) => (
-
- {children}
-
- ),
- }}
- >
- {message.content}
-
+ ) : (
+
+
+ {children}
+
+
+ );
+ },
+ // Style links
+ a: ({ children, href }) => (
+
+ {children}
+
+ ),
+ // Style lists
+ ul: ({ children }) => (
+
+ {children}
+
+ ),
+ ol: ({ children }) => (
+
+ {children}
+
+ ),
+ // Style paragraphs
+ p: ({ children }) => (
+
+ {children}
+
+ ),
+ } as Components}
+ >
+ {message.content}
+
+
{isAgent && (