'use client' import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert' import { Palette, RocketIcon } from 'lucide-react' import { Button } from './ui/button' import Link from 'next/link' import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { toast } from 'react-hot-toast' import { useState, useTransition } from 'react' import { Form } from '@/components/ui/form' export function AlertDemo() { const [email, setEmail] = useState('') const handleSubmit = async (e: any) => { e.preventDefault() const email = e.target.email.value try { const response = await fetch('/api/emails', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email }) }) const data = await response.json() if (data.message) { toast.success(data.message) setEmail('') } else { console.error(data, 'ha') } } catch (error) { console.error('Error:', error) } } return (
Heads up!

This is a demo. You can get the github repository

here

Starter Kit Enter your email to get the starterkit link in your inbox
setEmail(e.target.value)} name="email" id="email" type="email" required placeholder="tylerdurder@gmail.com" className="mt-3" value={email} />
) }