Skip to content

Commit

Permalink
move conditionals into Markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
koji committed May 31, 2024
1 parent ca2836a commit b1ec263
Showing 1 changed file with 13 additions and 28 deletions.
41 changes: 13 additions & 28 deletions opentrons-ai-client/src/molecules/ChatDisplay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,34 +65,19 @@ export function ChatDisplay({ chat, chatId }: ChatDisplayProps): JSX.Element {
gridGap={SPACING.spacing16}
position={POSITION_RELATIVE}
>
{isUser ? (
<Markdown
components={{
div: undefined,
ul: UnnumberedListText,
h2: HeaderText,
li: ListItemText,
p: ParagraphText,
a: ExternalLink,
}}
>
{reply}
</Markdown>
) : (
<Markdown
components={{
div: undefined,
ul: UnnumberedListText,
h2: HeaderText,
li: ListItemText,
p: ParagraphText,
a: ExternalLink,
code: CodeText,
}}
>
{reply}
</Markdown>
)}
<Markdown
components={{
div: undefined,
ul: UnnumberedListText,
h2: HeaderText,
li: ListItemText,
p: ParagraphText,
a: isUser ? undefined : ExternalLink,
code: isUser ? undefined : CodeText,
}}
>
{reply}
</Markdown>

{!isUser ? (
<PrimaryButton
Expand Down

0 comments on commit b1ec263

Please sign in to comment.