Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/Docs/DocsHelperTextMinimal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function DocsHelperTextHeader({
trailing={
url && (
<AccessibleLink href={url} newTab>
Learn more →
learn more →
</AccessibleLink>
)
}
Expand All @@ -67,7 +67,7 @@ export function DocsHelperTextHeader({
newTab
className={styles.learnMoreLink}
>
Learn more →
learn more →
</AccessibleLink>
)
)}
Expand Down
29 changes: 17 additions & 12 deletions src/components/auth/ApiKeyAuth/ApiKeyAuthContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { capitalize } from "src/utils";

import { MetadataInput } from "components/auth/MetadataInput";
import { DocsHelperText } from "components/Docs/DocsHelperText";
import { DocsHelperTextHeader } from "components/Docs/DocsHelperTextMinimal";

import {
getProviderMetadata,
Expand Down Expand Up @@ -61,6 +61,7 @@ export function ApiKeyAuthForm({
const isSubmitDisabled =
isButtonDisabled || !isApiKeyValid || !isMetadataValid;
const docsURL = providerInfo.apiKeyOpts?.docsURL;
const providerDisplayName = providerName || capitalize(provider);

const onHandleSubmit = () => {
const metadata = getProviderMetadata(metadataInputs, formData);
Expand All @@ -80,19 +81,23 @@ export function ApiKeyAuthForm({
marginTop: "1rem",
}}
>
{docsURL && (
<DocsHelperText
<div style={{ display: "flex", flexDirection: "column", gap: "0.25rem" }}>
<DocsHelperTextHeader
url={docsURL}
providerDisplayName={providerName || capitalize(provider)}
credentialName="API key"
inputName={`${providerDisplayName} API Key`}
prompt={
docsURL
? `Where to find your ${providerDisplayName} API key:`
: undefined
}
/>
)}
<FormComponent.PasswordInput
id="apiKey"
name="apiKey"
placeholder="API Key"
onChange={handleChange}
/>
<FormComponent.PasswordInput
id="apiKey"
name="apiKey"
placeholder="Paste your API key here"
onChange={handleChange}
/>
</div>
{metadataInputs.map((metadata: MetadataItemInput) => (
<MetadataInput
key={metadata.name}
Expand Down
Loading