b7f52be4c9
CI / Run CI (push) Has been cancelled
CI / check-backend (push) Has been cancelled
CI / check-frontend (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / e2e-tests (push) Has been cancelled
Copilot Setup Steps / copilot-setup-steps (push) Has been cancelled
29 lines
811 B
TypeScript
29 lines
811 B
TypeScript
import { cn, hasMessage } from '@/lib/utils';
|
|
import { MutableRefObject } from 'react';
|
|
|
|
import { FileSpec, useChatMessages } from '@chainlit/react-client';
|
|
|
|
import WaterMark from '@/components/WaterMark';
|
|
|
|
import MessageComposer from './MessageComposer';
|
|
|
|
interface Props {
|
|
fileSpec: FileSpec;
|
|
onFileUpload: (payload: File[]) => void;
|
|
onFileUploadError: (error: string) => void;
|
|
autoScrollRef: MutableRefObject<boolean>;
|
|
showIfEmptyThread?: boolean;
|
|
}
|
|
|
|
export default function ChatFooter({ showIfEmptyThread, ...props }: Props) {
|
|
const { messages } = useChatMessages();
|
|
if (!hasMessage(messages) && !showIfEmptyThread) return null;
|
|
|
|
return (
|
|
<div className={cn('relative flex flex-col items-center gap-2 w-full')}>
|
|
<MessageComposer {...props} />
|
|
<WaterMark />
|
|
</div>
|
|
);
|
|
}
|