mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
chat ui fix size
This commit is contained in:
parent
f3237c615e
commit
f314e08ab4
1 changed files with 14 additions and 3 deletions
|
@ -455,7 +455,13 @@ const ChatUI: React.FC<ChatUIProps> = ({
|
||||||
{message.reasoningContent && (
|
{message.reasoningContent && (
|
||||||
<ReasoningContent reasoningContent={message.reasoningContent} />
|
<ReasoningContent reasoningContent={message.reasoningContent} />
|
||||||
)}
|
)}
|
||||||
<div className="whitespace-pre-wrap break-words max-w-full message-content">
|
<div className="whitespace-pre-wrap break-words max-w-full message-content"
|
||||||
|
style={{
|
||||||
|
wordWrap: 'break-word',
|
||||||
|
overflowWrap: 'break-word',
|
||||||
|
wordBreak: 'break-word',
|
||||||
|
hyphens: 'auto'
|
||||||
|
}}>
|
||||||
{message.isImage ? (
|
{message.isImage ? (
|
||||||
<img
|
<img
|
||||||
src={message.content}
|
src={message.content}
|
||||||
|
@ -477,16 +483,21 @@ const ChatUI: React.FC<ChatUIProps> = ({
|
||||||
language={match[1]}
|
language={match[1]}
|
||||||
PreTag="div"
|
PreTag="div"
|
||||||
className="rounded-md my-2"
|
className="rounded-md my-2"
|
||||||
|
wrapLines={true}
|
||||||
|
wrapLongLines={true}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
{String(children).replace(/\n$/, '')}
|
{String(children).replace(/\n$/, '')}
|
||||||
</SyntaxHighlighter>
|
</SyntaxHighlighter>
|
||||||
) : (
|
) : (
|
||||||
<code className={`${className} px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono`} {...props}>
|
<code className={`${className} px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono`} style={{ wordBreak: 'break-word' }} {...props}>
|
||||||
{children}
|
{children}
|
||||||
</code>
|
</code>
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
|
pre: ({ node, ...props }) => (
|
||||||
|
<pre style={{ overflowX: 'auto', maxWidth: '100%' }} {...props} />
|
||||||
|
)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{message.content}
|
{message.content}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue