import React, { useState, useEffect } from 'react'; import './App.css'; import Header from './components/Header'; import Footer from './components/Footer'; import TextSelector from './components/TextSelector'; import GeminiChat from './components/GeminiChat'; interface SelectedWord { word: string; } function App() { const [selectedWords, setSelectedWords] = useState([]); const [geminiInput, setGeminiInput] = useState(''); const selectedWordsText = selectedWords.map(w => w.word).join(', '); const GEMINI_API_KEY = process.env.REACT_APP_GEMINI_API_KEY || ''; useEffect(() => { if (!GEMINI_API_KEY) { console.error('Gemini API key not found'); } }, [GEMINI_API_KEY]); const handleGenerateWithAI = () => { if (!selectedWordsText) { alert('Please select some words first'); return; } if (!GEMINI_API_KEY) { alert('API key not configured. Please check the setup.'); return; } const prompt = `Please write the English and their three Hindi meaning side by side for these words:- ${selectedWordsText}`; setGeminiInput(prompt); }; return (

Selected Words

{selectedWordsText || 'No words selected'}
); } export default App;