fix: add padding to chat message

This commit is contained in:
shadcn 2023-06-11 23:07:38 +04:00
parent 857a99736f
commit 23ce83a92d

View file

@ -17,7 +17,7 @@ export function ChatMessage({ message, ...props }: ChatMessageProps) {
<div className={cn('relative mb-4 flex items-start md:-ml-12')} {...props}> <div className={cn('relative mb-4 flex items-start md:-ml-12')} {...props}>
<div <div
className={cn( className={cn(
'flex h-8 w-8 shrink-0 select-none items-center justify-center rounded-full border', 'flex h-8 w-8 shrink-0 select-none items-center justify-center rounded-md border shadow',
message.role === 'user' message.role === 'user'
? 'bg-background' ? 'bg-background'
: 'bg-primary text-primary-foreground' : 'bg-primary text-primary-foreground'
@ -29,7 +29,7 @@ export function ChatMessage({ message, ...props }: ChatMessageProps) {
<OpenAI className="h-4 w-4" /> <OpenAI className="h-4 w-4" />
)} )}
</div> </div>
<div className="ml-4"> <div className="ml-4 px-1">
<MemoizedReactMarkdown <MemoizedReactMarkdown
className="prose leading-6 dark:prose-invert prose-p:leading-[1.8rem] prose-pre:rounded-md prose-pre:bg-[#282c34]" className="prose leading-6 dark:prose-invert prose-p:leading-[1.8rem] prose-pre:rounded-md prose-pre:bg-[#282c34]"
remarkPlugins={[remarkGfm, remarkMath]} remarkPlugins={[remarkGfm, remarkMath]}