feat: fill out reddit required details + more user/pass stuff

This commit is contained in:
Nicholas Tindle 2024-12-20 13:01:25 -06:00
parent b6b97f10b8
commit cb3808cb78
No known key found for this signature in database
GPG Key ID: C4A2154D91363A47
4 changed files with 25 additions and 0 deletions

View File

@ -66,6 +66,7 @@ export const providerIcons: Record<
pinecone: fallbackIcon,
slant3d: fallbackIcon,
replicate: fallbackIcon,
reddit: fallbackIcon,
fal: fallbackIcon,
revid: fallbackIcon,
unreal_speech: fallbackIcon,
@ -271,6 +272,12 @@ export const CredentialsInput: FC<{
Enter API key
</Button>
)}
{supportsUserPassword && (
<Button onClick={() => setUserPasswordCredentialsModalOpen(true)}>
<ProviderIcon className="mr-2 h-4 w-4" />
Enter user password
</Button>
)}
</div>
{modals}
{oAuthError && (
@ -342,6 +349,13 @@ export const CredentialsInput: FC<{
{credentials.title}
</SelectItem>
))}
{savedUserPasswordCredentials.map((credentials, index) => (
<SelectItem key={index} value={credentials.id}>
<ProviderIcon className="mr-2 inline h-4 w-4" />
<IconUserPlus className="mr-1.5 inline" />
{credentials.title}
</SelectItem>
))}
<SelectSeparator />
{supportsOAuth2 && (
<SelectItem value="sign-in">
@ -355,6 +369,12 @@ export const CredentialsInput: FC<{
Add new API key
</SelectItem>
)}
{supportsUserPassword && (
<SelectItem value="add-user-password">
<IconUserPlus className="mr-1.5 inline" />
Add new user password
</SelectItem>
)}
</SelectContent>
</Select>
{modals}

View File

@ -35,6 +35,7 @@ const providerDisplayNames: Record<CredentialsProviderName, string> = {
open_router: "Open Router",
pinecone: "Pinecone",
slant3d: "Slant3D",
reddit: "Reddit",
replicate: "Replicate",
fal: "FAL",
revid: "Rev.ID",

View File

@ -94,6 +94,8 @@ export default function useCredentials(): CredentialsData | null {
)
: provider.savedOAuthCredentials;
const savedUserPasswordCredentials = provider.savedUserPasswordCredentials;
return {
...provider,
provider: providerName,
@ -102,6 +104,7 @@ export default function useCredentials(): CredentialsData | null {
supportsOAuth2,
supportsUserPassword,
savedOAuthCredentials,
savedUserPasswordCredentials,
isLoading: false,
};
}

View File

@ -121,6 +121,7 @@ export const PROVIDER_NAMES = {
SLANT3D: "slant3d",
REPLICATE: "replicate",
FAL: "fal",
REDDIT: "reddit",
REVID: "revid",
UNREAL_SPEECH: "unreal_speech",
EXA: "exa",