import React, { useState } from 'react'; import { IconButton } from '~/components/ui/IconButton'; interface APIKeyManagerProps { provider: string; apiKey: string; setApiKey: (key: string) => void; } export const APIKeyManager: React.FC = ({ provider, apiKey, setApiKey }) => { const [isEditing, setIsEditing] = useState(false); const [tempKey, setTempKey] = useState(apiKey); const handleSave = () => { setApiKey(tempKey); setIsEditing(false); }; return (
{provider} API Key: {isEditing ? ( <> setTempKey(e.target.value)} className="flex-1 p-1 text-sm rounded border border-bolt-elements-borderColor bg-bolt-elements-prompt-background text-bolt-elements-textPrimary focus:outline-none focus:ring-2 focus:ring-bolt-elements-focus" />
setIsEditing(false)} title="Cancel">
) : ( <> {apiKey ? '••••••••' : 'Not set (will still work if set in .env file)'} setIsEditing(true)} title="Edit API Key">
)}
); };