"use client"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Badge } from "@/components/ui/badge"; import { badgeVariants } from "@/components/ui/badge"; import Link from "next/link"; import { useState } from "react"; import { Alert } from "@/components/ui/alert"; import { AlertCircle, Check } from "lucide-react"; export default function Home() { const [email, setEmail] = useState(""); const [alertType, setAlertType] = useState("default"); const [alertMessage, setAlertMessage] = useState(""); const [submitted, setSubmitted] = useState(false); async function handleSubmit(e: any) { e.preventDefault(); // prevent the default form submission behavior const res = await fetch("/api/waitlist", { method: "POST", // specify the HTTP method headers: { "Content-Type": "application/json" }, // specify the content type body: JSON.stringify({ email: email, }), }); const data = await res.json(); if (data.email) { setAlertType("success"); setAlertMessage("You have been added to the waitlist!"); setSubmitted(true); } else { setAlertType("error"); setAlertMessage("Something went wrong. Please try again later."); } } return (
Follow us on Twitter!

Redefine Project Management.

Empowering tech startups to automate, optimize, and streamline projects
like never before.

setEmail(e.target.value)} /> {submitted ? ( ) : ( )}
{alertMessage && ( {alertType === "success" ? ( ) : ( )} {alertMessage} )}
); }