import React, { useState, useEffect } from 'react'; import { Download, RefreshCw, Smartphone, CheckCircle, Zap } from 'lucide-react'; const App = () => { const [imageUrl, setImageUrl] = useState(''); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(null); const apiKey = ""; const generateLogo = async () => { setIsLoading(true); setError(null); // Промпт для максимально жирного и чистого логотипа без рамок const promptText = "One single massive ultra-bold iconic symbol inspired by geometric patterns. Extremely thick solid golden lines. The symbol fills the entire frame. Minimalist 2D flat design, solid deep turquoise background. No borders, no outlines, no small details. Surgical precision, high-end branding. 512x512."; try { let retries = 0; const maxRetries = 5; let success = false; while (retries < maxRetries && !success) { try { const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/imagen-4.0-generate-001:predict?key=${apiKey}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ instances: [{ prompt: promptText }], parameters: { sampleCount: 1 } }) }); if (!response.ok) throw new Error('Generation failed'); const result = await response.json(); if (result.predictions && result.predictions[0].bytesBase64Encoded) { const base64Data = `data:image/png;base64,${result.predictions[0].bytesBase64Encoded}`; setImageUrl(base64Data); success = true; } else { throw new Error('No image data'); } } catch (err) { retries++; if (retries === maxRetries) throw err; await new Promise(res => setTimeout(res, Math.pow(2, retries) * 1000)); } } } catch (err) { setError("Ошибка загрузки. Попробуйте еще раз."); } finally { setIsLoading(false); } }; const downloadImage = () => { if (!imageUrl) return; const link = document.createElement('a'); link.href = imageUrl; link.download = 'qazaq_logo_512.png'; document.body.appendChild(link); link.click(); document.body.removeChild(link); }; useEffect(() => { generateLogo(); }, []); return (

ВАШ ЛОГОТИП

{isLoading ? (
) : ( Logo )}
КРУГ
ANDROID
); }; export default App;