mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-31 08:56:48 +00:00
* 🔧 fix: Ensure loading state is correctly set when files are empty or in progress * 🔧 fix: Update ephemeral agent state on file upload error for execute code tool resource * 🔧 fix: Reset ephemeral agent state for tool when authentication fails * refactor: Pass conversation prop to FileFormChat and AttachFileChat components
31 lines
1,007 B
TypeScript
31 lines
1,007 B
TypeScript
import { memo } from 'react';
|
|
import { useRecoilValue } from 'recoil';
|
|
import type { TConversation } from 'librechat-data-provider';
|
|
import { useChatContext } from '~/Providers';
|
|
import { useFileHandling } from '~/hooks';
|
|
import FileRow from './FileRow';
|
|
import store from '~/store';
|
|
|
|
function FileFormChat({ conversation }: { conversation: TConversation | null }) {
|
|
const { files, setFiles, setFilesLoading } = useChatContext();
|
|
const chatDirection = useRecoilValue(store.chatDirection).toLowerCase();
|
|
const { endpoint: _endpoint } = conversation ?? { endpoint: null };
|
|
const { abortUpload } = useFileHandling();
|
|
|
|
const isRTL = chatDirection === 'rtl';
|
|
|
|
return (
|
|
<>
|
|
<FileRow
|
|
files={files}
|
|
setFiles={setFiles}
|
|
abortUpload={abortUpload}
|
|
setFilesLoading={setFilesLoading}
|
|
isRTL={isRTL}
|
|
Wrapper={({ children }) => <div className="mx-2 mt-2 flex flex-wrap gap-2">{children}</div>}
|
|
/>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default memo(FileFormChat);
|