import React from 'react'; import { Card } from '../ui/card'; import { Lock } from 'lucide-react'; import { Input } from '../ui/input'; import { Button } from '../ui/button'; import { required_keys } from './models/hardcoded_stuff'; import { isSecretKey } from './api_keys/utils'; // import UnionIcon from "../images/Union@2x.svg"; interface ProviderSetupModalProps { provider: string; model: string; endpoint: string; title?: string; onSubmit: (configValues: { [key: string]: string }) => void; onCancel: () => void; } export function ProviderSetupModal({ provider, model, endpoint, title, onSubmit, onCancel, }: ProviderSetupModalProps) { const [configValues, setConfigValues] = React.useState<{ [key: string]: string }>({}); const requiredKeys = required_keys[provider] || ['API Key']; const headerText = title || `Setup ${provider}`; const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); onSubmit(configValues); }; return (
{/* Header */}
{/* Purple icon */} {/*
Union icon
*/}

{headerText}

{/* Form */}
{requiredKeys.map((keyName) => (
setConfigValues((prev) => ({ ...prev, [keyName]: e.target.value, })) } placeholder={keyName} className="w-full h-14 px-4 font-regular rounded-lg border shadow-none border-gray-300 bg-white text-lg placeholder:text-gray-400 font-regular text-gray-900" required />
))}
{`Your configuration values will be stored securely in the keychain and used only for making requests to ${provider}`}
{/* Actions */}
); }