import { useState, useEffect } from "react"; export default function SettingsModal({ isOpen, onClose, onSave }) { const [geminiKey, setGeminiKey] = useState(""); const [openaiKey, setOpenaiKey] = useState(""); const [activeTab, setActiveTab] = useState("gemini"); const [saved, setSaved] = useState(false); // Load keys from localStorage on mount useEffect(() => { const stored = localStorage.getItem("gemini_api_key") || ""; setGeminiKey(stored); }, [isOpen]); const handleSave = () => { localStorage.setItem("gemini_api_key", geminiKey); setSaved(true); onSave(geminiKey); setTimeout(() => setSaved(false), 2000); }; if (!isOpen) return null; return (
{/* Header */}
settings

Settings

{/* Tabs */}
{/* Content */}
{activeTab === "gemini" && (
setGeminiKey(e.target.value)} placeholder="Enter your Gemini API key (e.g., AIza...)" className="w-full px-3 py-2 bg-surface-container border border-outline-variant rounded-lg text-on-surface placeholder-on-surface-variant/50 focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/30 transition-colors" />

Get your free API key from{" "} Google AI Studio

💡 Tip: Adding your Gemini API key enables AI-powered response synthesis. Your key is stored locally in your browser and never sent to our servers.

)} {activeTab === "about" && (

Oracle of Librio

An intelligent RAG (Retrieval-Augmented Generation) system for banking document analysis.

How It Works

1. Upload documents (CSV, XLSX, PDF, etc.)
2. System indexes them into ChromaDB vector database
3. Ask questions and get AI-synthesized answers with citations

Privacy

Your documents and API keys are stored locally. No data is sent to external servers unless you enable LLM synthesis.

)}
); }