import React, { useState } from 'react'; import { Key, ExternalLink, X } from 'lucide-react'; interface ApiKeyModalProps { isOpen: boolean; onSave: (key: string) => void; onClose?: () => void; currentKey?: string; } export const ApiKeyModal: React.FC = ({ isOpen, onSave, onClose, currentKey }) => { const [apiKey, setApiKey] = useState(currentKey || ''); const [error, setError] = useState(''); if (!isOpen) return null; const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); if (!apiKey.trim()) { setError('Bitte gib einen API Key ein'); return; } if (!apiKey.startsWith('AI')) { setError('Der Key sollte mit "AI" beginnen'); return; } onSave(apiKey.trim()); }; return (

Gemini API Key

{onClose && ( )}

Dein API Key wird nur lokal in deinem Browser gespeichert und nie an unsere Server gesendet.

{ setApiKey(e.target.value); setError(''); }} placeholder="AIza..." className="w-full px-4 py-3 border border-slate-300 rounded-xl focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none transition-all" autoFocus /> {error &&

{error}

}
API Key bei Google AI Studio holen
); };