diff --git a/App.tsx b/App.tsx index 94dbe11b3..8f599b73b 100644 --- a/App.tsx +++ b/App.tsx @@ -1,6 +1,6 @@ import React, { useState, useMemo, useEffect } from 'react'; -import { Search, Sparkles, MapPin, Sun, Moon, Globe, Heart, Database, PhoneForwarded, Key, ExternalLink, ArrowRight, User as UserIcon, Shield, Lock } from 'lucide-react'; +import { Search, Sparkles, MapPin, Sun, Moon, Globe, Heart, Database, PhoneForwarded, User as UserIcon, Shield } from 'lucide-react'; import { MapView } from './components/MapView'; import { TableView } from './components/TableView'; import { GeminiChat } from './components/GeminiChat'; @@ -31,7 +31,6 @@ const App: React.FC = () => { const [isPrivacyOpen, setIsPrivacyOpen] = useState(false); const [isTermsOpen, setIsTermsOpen] = useState(false); const [referralOrg, setReferralOrg] = useState(null); - const [isKeySelected, setIsKeySelected] = useState(null); const [mapKey, setMapKey] = useState(0); // RBAC State @@ -42,29 +41,13 @@ const App: React.FC = () => { }); const [isProfileOpen, setIsProfileOpen] = useState(false); - useEffect(() => { - const checkKey = async () => { - if (window.aistudio && typeof window.aistudio.hasSelectedApiKey === 'function') { - const selected = await window.aistudio.hasSelectedApiKey(); - setIsKeySelected(selected); - } else { - setIsKeySelected(true); - } - }; - checkKey(); - }, []); - useEffect(() => { document.documentElement.classList.toggle('dark', isDarkMode); localStorage.setItem('theme', isDarkMode ? 'dark' : 'light'); }, [isDarkMode]); - const handleSelectKey = async () => { - if (window.aistudio && typeof window.aistudio.openSelectKey === 'function') { - await window.aistudio.openSelectKey(); - setIsKeySelected(true); - setMapKey(prev => prev + 1); - } + const handleResetMap = () => { + setMapKey(prev => prev + 1); }; const changeRole = (role: UserRole) => { @@ -86,37 +69,6 @@ const App: React.FC = () => { }); }, [organizations, activeRegion, searchTerm]); - if (isKeySelected === false) { - return ( -
-
-
- -
-

Потрібна активація

-

- Для роботи мапи та інтелектуального пошуку необхідно підключити ваш Google Cloud Project з активованим Google Maps API та білінгом. -

-
- - - Документація по білінгу - -
-
-
- ); - } - return (
{showIntro && ( @@ -242,7 +194,7 @@ const App: React.FC = () => { center={REGION_CONFIG[activeRegion].center as [number, number]} zoom={REGION_CONFIG[activeRegion].zoom} isDarkMode={isDarkMode} - onResetKey={handleSelectKey} + onResetKey={handleResetMap} />
diff --git a/components/geminiService.ts b/components/geminiService.ts index 0fad773f0..cf152c392 100644 --- a/components/geminiService.ts +++ b/components/geminiService.ts @@ -49,7 +49,7 @@ export const analyzeData = async (query: string, organizations: Organization[], const isMapQuery = lowerQuery.includes('де') || lowerQuery.includes('поруч') || lowerQuery.includes('маршрут') || lowerQuery.includes('як дістатися') || lowerQuery.includes('адреса') || lowerQuery.includes('карта'); - const modelName = isMapQuery ? 'gemini-2.5-flash' : (useThinking ? 'gemini-3-pro-preview' : 'gemini-3-flash-preview'); + const modelName = isMapQuery ? 'gemini-2.5-flash' : (useThinking ? 'gemini-2.5-pro' : 'gemini-2.5-flash'); const config: any = { temperature: 0.7, @@ -70,7 +70,7 @@ export const analyzeData = async (query: string, organizations: Organization[], } } else { config.tools = [{ googleSearch: {} }]; - if (useThinking && modelName === 'gemini-3-pro-preview') { + if (useThinking && modelName === 'gemini-2.5-pro') { config.thinkingConfig = { thinkingBudget: 32768 }; } } @@ -101,7 +101,7 @@ export const analyzeData = async (query: string, organizations: Organization[], export const getIntelligentSummary = async (organizations: Organization[]): Promise => { const ai = new GoogleGenAI({ apiKey: import.meta.env.VITE_GEMINI_API_KEY }); const response = await ai.models.generateContent({ - model: 'gemini-3-flash-preview', + model: 'gemini-2.5-flash', contents: `Надай короткий огляд (до 3 речень) стану допомоги в Україні на основі цих ${organizations.length} організацій. Пиши як пані Думка.`, config: { systemInstruction: PANI_DUMKA_PROMPT } }); diff --git a/index.css b/index.css new file mode 100644 index 000000000..b5c61c956 --- /dev/null +++ b/index.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/index.html b/index.html index ebf0e239e..08fa4d14b 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,6 @@ Інклюзивна мапа соціальних послуг України | ШІ Пані Думка - @@ -47,26 +46,6 @@ .gm-style-iw-d { overflow: hidden !important; } .gm-ui-hover-svc { display: none !important; } - - diff --git a/index.tsx b/index.tsx index aaa0c6e46..6cb8df69e 100644 --- a/index.tsx +++ b/index.tsx @@ -1,6 +1,7 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; +import './index.css'; import App from './App'; const rootElement = document.getElementById('root'); diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 000000000..2aa7205d4 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +}; diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 000000000..e3b6fec9a --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,13 @@ +/** @type {import('tailwindcss').Config} */ +export default { + content: [ + './index.html', + './*.tsx', + './components/**/*.tsx', + ], + darkMode: 'class', + theme: { + extend: {}, + }, + plugins: [], +};