forked from danny-avila/LibreChat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "🚑 fix(export): Issue exporting Conversation with Assistants (d…
…anny-avila#2769)" This reverts commit 13f95a4.
- Loading branch information
1 parent
44c5629
commit d990aa9
Showing
7 changed files
with
493 additions
and
627 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
client/src/components/Nav/ExportConversation/ExportConversation.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { useState, forwardRef } from 'react'; | ||
import { useRecoilValue } from 'recoil'; | ||
import { Download } from 'lucide-react'; | ||
import ExportModal from './ExportModal'; | ||
import { useLocalize } from '~/hooks'; | ||
import { cn } from '~/utils/'; | ||
import store from '~/store'; | ||
|
||
const ExportConversation = forwardRef(() => { | ||
const [open, setOpen] = useState(false); | ||
const localize = useLocalize(); | ||
|
||
const conversation = useRecoilValue(store.conversation) || {}; | ||
|
||
const exportable = | ||
conversation?.conversationId && | ||
conversation?.conversationId !== 'new' && | ||
conversation?.conversationId !== 'search'; | ||
|
||
const clickHandler = () => { | ||
if (exportable) { | ||
setOpen(true); | ||
} | ||
}; | ||
|
||
return ( | ||
<> | ||
<button | ||
className={cn( | ||
'flex w-full cursor-pointer items-center gap-3 px-3 py-3 text-sm text-white transition-colors duration-200 hover:bg-gray-700', | ||
exportable ? 'cursor-pointer text-white' : 'cursor-not-allowed text-gray-400', | ||
)} | ||
onClick={clickHandler} | ||
> | ||
<Download size={16} /> | ||
{localize('com_nav_export_conversation')} | ||
</button> | ||
|
||
<ExportModal open={open} onOpenChange={setOpen} /> | ||
</> | ||
); | ||
}); | ||
|
||
export default ExportConversation; |
Oops, something went wrong.