'use client' import { useState } from "react" export default function CreateEventForm() { const [name, setName] = useState(''); async function handleSubmit(e: React.FormEvent) { e.preventDefault() const res = await fetch('api/events', { method: 'POST', body: JSON.stringify({ name }), }); const event = await res.json(); console.log('Created:', event); }; return (
) }