import React, { useState } from "react"; import "./App.css"; function App() { const [prompt, setPrompt] = useState(""); const [image, setImage] = useState(null); const [loading, setLoading] = useState(false); const handleGenerate = async (isPremium) => { setLoading(true); try { const response = await fetch("http://localhost:5000/generate", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ prompt, premium: isPremium }), }); const data = await response.json(); setImage(data.image_url); } catch (error) { console.error("Görsel oluşturulurken hata oluştu:", error); } setLoading(false); }; return (
{/* HEADER */}
Logo
Yeni Proje +
Profile
{/* SOL PANEL */}
{/* PROMPT ALANI */} {/* BUTONLAR */}
{/* GÖRSEL ALANI */}
{loading &&

Görsel oluşturuluyor...

} {image && Generated Floor Plan}
); } export default App;