'use client' import { useState } from 'react' import { authClient } from '@/lib/auth-client' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' export default function LoginPage() { const [email, setEmail] = useState('') const [submitted, setSubmitted] = useState(false) const [error, setError] = useState(null) const [loading, setLoading] = useState(false) async function handleSubmit(e: React.FormEvent) { e.preventDefault() setLoading(true) setError(null) const { error } = await authClient.signIn.magicLink({ email, callbackURL: '/dashboard', }) if (error) { setError(error.message ?? 'Could not send link. Have you been invited?') } else { setSubmitted(true) } setLoading(false) } if (submitted) { return (

Check your email

We sent a magic link to {email}. Tap it to sign in.

) } return (

MulliganMates

Sign in to track your round

setEmail(e.target.value)} required autoComplete="email" autoFocus />
{error &&

{error}

}
) }