Merge with master fixes

This commit is contained in:
eduardruzga 2024-11-25 19:57:53 +02:00
parent e2d4b0a4f2
commit 15d490dda4
2 changed files with 8 additions and 4 deletions

View File

@ -19,9 +19,8 @@ import * as Tooltip from '@radix-ui/react-tooltip';
import styles from './BaseChat.module.scss'; import styles from './BaseChat.module.scss';
import type { ProviderInfo } from '~/utils/types'; import type { ProviderInfo } from '~/utils/types';
import { ExportChatButton } from '~/components/chat/chatExportAndImport/ExportChatButton'; import { ExportChatButton } from '~/components/chat/chatExportAndImport/ExportChatButton';
import { ImportButton } from '~/components/chat/chatExportAndImport/ImportButton'; import { ImportButtons } from '~/components/chat/chatExportAndImport/ImportButtons';
import { ExamplePrompts } from '~/components/chat/ExamplePrompts'; import { ExamplePrompts } from '~/components/chat/ExamplePrompts';
import { ImportFolderButton } from '~/components/chat/ImportFolderButton';
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
const providerList = PROVIDER_LIST; const providerList = PROVIDER_LIST;
@ -311,7 +310,7 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
</div> </div>
</div> </div>
</div> </div>
{!chatStarted && ImportButton(importChat)} {!chatStarted && ImportButtons(importChat)}
{!chatStarted && ExamplePrompts(sendMessage)} {!chatStarted && ExamplePrompts(sendMessage)}
</div> </div>
<ClientOnly>{() => <Workbench chatStarted={chatStarted} isStreaming={isStreaming} />}</ClientOnly> <ClientOnly>{() => <Workbench chatStarted={chatStarted} isStreaming={isStreaming} />}</ClientOnly>

View File

@ -1,8 +1,9 @@
import type { Message } from 'ai'; import type { Message } from 'ai';
import { toast } from 'react-toastify'; import { toast } from 'react-toastify';
import React from 'react'; import React from 'react';
import { ImportFolderButton } from '~/components/chat/ImportFolderButton';
export function ImportButton(importChat: ((description: string, messages: Message[]) => Promise<void>) | undefined) { export function ImportButtons(importChat: ((description: string, messages: Message[]) => Promise<void>) | undefined) {
return ( return (
<div className="flex flex-col items-center justify-center flex-1 p-4"> <div className="flex flex-col items-center justify-center flex-1 p-4">
<input <input
@ -59,6 +60,10 @@ export function ImportButton(importChat: ((description: string, messages: Messag
<div className="i-ph:upload-simple" /> <div className="i-ph:upload-simple" />
Import Chat Import Chat
</button> </button>
<ImportFolderButton
importChat={importChat}
className="px-4 py-2 rounded-lg border border-bolt-elements-borderColor bg-bolt-elements-prompt-background text-bolt-elements-textPrimary hover:bg-bolt-elements-background-depth-3 transition-all flex items-center gap-2"
/>
</div> </div>
</div> </div>
</div> </div>