Skip to content

Commit

Permalink
fix(assistant): consistent font sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
krisantrobus committed Jan 27, 2025
1 parent 9fe763e commit 5da2ce1
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import {
AIChatMessageBodyProps,
} from "@twilio-paste/ai-chat-log";
import { UserIcon } from "@twilio-paste/icons/esm/UserIcon";
import { compiler } from "markdown-to-jsx";
import { type Message } from "openai/resources/beta/threads/messages";
import * as React from "react";

import { formatTimestamp } from "../../utils/formatTimestamp";
import { AssistantMarkdown } from "./AssistantMarkdown";
import { assistantMarkdownOptions } from "./AssistantMarkdown";

interface UserMessageProps extends AIChatMessageBodyProps {
threadMessage: Message;
Expand All @@ -25,9 +26,9 @@ export const UserMessage: React.FC<UserMessageProps> = ({ threadMessage, ...prop
You
</AIChatMessageAuthor>
<AIChatMessageBody {...props}>
{threadMessage.content[0].type === "text" && (
<AssistantMarkdown key={threadMessage.id}>{threadMessage.content[0].text.value}</AssistantMarkdown>
)}
{threadMessage.content.length > 0 &&
threadMessage.content[0]?.type === "text" &&
compiler(threadMessage.content[0].text.value, assistantMarkdownOptions)}
</AIChatMessageBody>
</AIChatMessage>
);
Expand Down

0 comments on commit 5da2ce1

Please sign in to comment.