import { useState } from "react";
import { Card, CardContent } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";export default function HighSchoolSelector() {
const [formData, setFormData] = useState({
gpa: "",
toefl: "",
ssat: "",
interests: "",
location: "",
});
const [recommendations, setRecommendations] = useState([]);const handleChange = (e) => {
setFormData({ ...formData, [e.target.name]: e.target.value });
};const handleSubmit = async () => {
const response = await fetch("/api/select-highschool", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(formData),
});
const data = await response.json();
setRecommendations(data.schools);
};return (
{recommendations.length > 0 && (
)}
);
}
AI美高选校测评
推荐学校:
-
{recommendations.map((school, index) => (
- {school} ))}