import { useState, useEffect } from 'react'; import { Key, Eye, EyeOff, Save, Trash } from 'lucide-react'; export default function Settings() { const [apiKey, setApiKey] = useState(''); const [showKey, setShowKey] = useState(false); const [status, setStatus] = useState(null); useEffect(() => { const savedKey = localStorage.getItem('sandbox_gemini_api_key') || ''; setApiKey(savedKey); }, []); const handleSave = () => { if (apiKey.trim()) { localStorage.setItem('sandbox_gemini_api_key', apiKey.trim()); setStatus('API Key saved successfully!'); } else { localStorage.removeItem('sandbox_gemini_api_key'); setStatus('API Key cleared.'); } setTimeout(() => setStatus(null), 3000); }; const handleClear = () => { localStorage.removeItem('sandbox_gemini_api_key'); setApiKey(''); setStatus('API Key cleared.'); setTimeout(() => setStatus(null), 3000); }; return (

key CUSTOM GEMINI API CONFIG

Configure a custom Gemini API key for Sandbox Mode AI evaluations & explanations.

setApiKey(e.target.value)} placeholder="AIzaSy..." className="w-full bg-white border-[3px] border-ink-black rounded-lg py-2.5 pl-10 pr-10 text-ink-black placeholder-trash-gray focus:outline-none focus:bg-white text-xs font-code-mono shadow-[inset_2px_2px_0px_rgba(0,0,0,0.1)]" />
Your key is stored locally in your browser's localStorage and is only sent to the local server in request headers.
{status && (
{status}
)}
); }