feat: add avatar (#47)

This commit is contained in:
Roberto Vidal
2024-08-22 10:11:38 +02:00
committed by GitHub
parent a7b1f5046d
commit b4cfe6ab8b
12 changed files with 104 additions and 85 deletions

View File

@@ -9,6 +9,7 @@ import { Messages } from './Messages.client';
import { SendButton } from './SendButton.client';
import styles from './BaseChat.module.scss';
import { useLoaderData } from '@remix-run/react';
interface BaseChatProps {
textareaRef?: React.RefObject<HTMLTextAreaElement> | undefined;
@@ -58,6 +59,7 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
ref,
) => {
const TEXTAREA_MAX_HEIGHT = chatStarted ? 400 : 200;
const { avatar } = useLoaderData<{ avatar?: string }>();
return (
<div
@@ -94,6 +96,7 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
className="flex flex-col w-full flex-1 max-w-chat px-4 pb-6 mx-auto z-1"
messages={messages}
isStreaming={isStreaming}
avatar={avatar}
/>
) : null;
}}