'use client'; import { AlertCircle, ExternalLink, X, Settings, Key } from 'lucide-react'; import { GeminiErrorInfo } from '@/lib/geminiErrorHandler'; import { ApiKeyInfo, getApiKeySourceDescription } from '@/lib/apiKeyHelper'; import { useRouter } from 'next/navigation'; interface GeminiErrorModalProps { error: GeminiErrorInfo; apiKeyInfo: ApiKeyInfo; onClose: () => void; } export function GeminiErrorModal({ error, apiKeyInfo, onClose }: GeminiErrorModalProps) { const router = useRouter(); const handleGoToSettings = () => { onClose(); router.push('/settings'); }; return (
Current API Key:
{apiKeyInfo.anonymized}
Source: {getApiKeySourceDescription(apiKeyInfo.source)}
{error.userMessage}
{error.retryAfterSeconds && (You can try again in {error.retryAfterSeconds} seconds.
Solutions:
{error.technicalMessage}