'use client';
import { useState } from "react";
import toast from "react-hot-toast";
export default function Start() {
const [form, setForm] = useState({
name: "",
company: "",
website: "",
project_type: "",
budget: "",
timeline: "",
description: ""
});
const [loading, setLoading] = useState(false);
const handleChange = (e: any) => {
setForm({ ...form, [e.target.name]: e.target.value });
};
const handleSubmit = async (e: any) => {
e.preventDefault();
setLoading(true);
try {
const res = await fetch("/api/submit", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(form),
});
const data = await res.json();
console.log(data);
toast.success("Form Submitted Successfully 🚀");
setForm({
name: "",
company: "",
website: "",
project_type: "",
budget: "",
timeline: "",
description: ""
});
} catch (err) {
console.error(err);
toast.error("Something went wrong ❌");
}
setLoading(false);
};
return (
<>
Tell us what you're building. We'll structure the rest.
100+ people already joined
Let's Build it Properly.Start A Project
the AAideA
Tell us what you're building. We'll structure the rest.