import { IoLogoGoogle } from 'react-icons/io'; import router from 'next/router'; import { toast } from 'react-toastify'; import { useState } from 'react'; type SignUpPanelProps = { signIn: ({}) => Promise<{ data: Record; error: { message: string }; }>; signUp: ({}) => Promise<{ data: Record; error: { message: string }; }>; }; const SignUpPanel = ({ signIn, signUp }: SignUpPanelProps): JSX.Element => { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const signup = (e: React.SyntheticEvent) => { e.preventDefault(); // Handle the login. Go to the homepage if success or display an error. signUp({ email, password, }).then((result) => { console.log(result); if (result.error) { toast.error(result.error.message); } else if (result.data?.confirmation_sent_at) { console.log(result.data.confirmation_sent_at); toast.success( 'A confirmation email has been sent to you, watch your mailbox!' ); } else if (result.data) { router.push('/'); } }); }; return (

Account Sign Up

{ setEmail(event.target.value); }} />
{ setPassword(event.target.value); }} />
or sign up with
); }; export default SignUpPanel;