'use client' import { signIn } from 'next-auth/react'; import React, { useState } from 'react' export default function SetupPage() { const [role, setRole] = useState<'COUPLE' | 'PLANNER' | null>(null); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [username, setUsername] = useState(''); async function handleSetup(e:React.FormEvent) { e.preventDefault(); const res = await fetch('/api/setup', { method: 'POST', body: JSON.stringify({ email, password, role }), }); if (res.ok) { await signIn('credentials', { email, password, callbackUrl: '/' }); } else { alert('Error setting up user'); } } if (!role) { return (