'use client' import { Dialog, DialogPanel, DialogTitle, Transition, TransitionChild } from '@headlessui/react' import { Fragment, useState } from 'react' export default function CreateEventModal({ isOpen, onClose, onSubmit }: { isOpen: boolean onClose: () => void onSubmit: (data: { name: string; date?: string; location?: string }) => void }) { const [name, setName] = useState('') const [date, setDate] = useState('') const [location, setLocation] = useState('') function handleSubmit(e: React.FormEvent) { e.preventDefault() onSubmit({ name, date, location }) setName('') setDate('') setLocation('') onClose() } return (
Create New Event
setName(e.target.value)} required /> setDate(e.target.value)} /> setLocation(e.target.value)} />
) }