import React, { useState } from "react"; export default function App() { const [input, setInput] = useState(""); const [prediction, setPrediction] = useState(""); const handlePredict = async () => { const res = await fetch("/api/predict", { method: "POST", body: JSON.stringify({ input }), headers: { "Content-Type": "application/json" } }); const data = await res.json(); setPrediction(data.prediction); }; return (
Predicted Next Day Close: ${prediction}
}