diff --git a/app/components/chat/APIKeyManager.tsx b/app/components/chat/APIKeyManager.tsx index 1343ece42..54654b535 100644 --- a/app/components/chat/APIKeyManager.tsx +++ b/app/components/chat/APIKeyManager.tsx @@ -6,9 +6,15 @@ interface APIKeyManagerProps { provider: ProviderInfo; apiKey: string; setApiKey: (key: string) => void; + getApiKeyLink?: string; + labelForGetApiKey?: string; } -export const APIKeyManager: React.FC = ({ provider, apiKey, setApiKey }) => { +export const APIKeyManager: React.FC = ({ + provider, + apiKey, + setApiKey, + }) => { const [isEditing, setIsEditing] = useState(false); const [tempKey, setTempKey] = useState(apiKey); @@ -43,7 +49,11 @@ export const APIKeyManager: React.FC = ({ provider, apiKey, setIsEditing(true)} title="Edit API Key">
- {!!provider?.getApiKeyLink ? {provider?.labelForGetApiKey || "Get API Key"} : "" } + + {provider?.getApiKeyLink && window.open(provider?.getApiKeyLink)} title="Edit API Key"> + {provider?.labelForGetApiKey || 'Get API Key'} +
+ } )}
diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index 134b4f8f7..09ee11878 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -7,7 +7,7 @@ import { Menu } from '~/components/sidebar/Menu.client'; import { IconButton } from '~/components/ui/IconButton'; import { Workbench } from '~/components/workbench/Workbench.client'; import { classNames } from '~/utils/classNames'; -import { MODEL_LIST, DEFAULT_PROVIDER, PROVIDER_LIST } from '~/utils/constants'; +import { MODEL_LIST, DEFAULT_PROVIDER, PROVIDER_LIST, ProviderInfo } from '~/utils/constants'; import { Messages } from './Messages.client'; import { SendButton } from './SendButton.client'; import { useState } from 'react'; @@ -30,9 +30,9 @@ const ModelSelector = ({ model, setModel, provider, setProvider, modelList, prov return (