'use client'; import React, { useState } from 'react'; import { useRouter } from 'next/navigation'; import Link from 'next/link'; import { signInWithGoogle } from '@/lib/auth'; export default function SignupPage() { const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [isSubmitting, setIsSubmitting] = useState(false); const [formError, setFormError] = useState(''); const router = useRouter(); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setIsSubmitting(true); setFormError(''); try { // Here you would connect to your backend API for registration console.log('Signing up', { name, email, password }); // Simulate successful registration setTimeout(() => { // Redirect to login page with success message router.push('/login?registered=true'); }, 1500); } catch (error) { console.error('Signup error:', error); setFormError('Something went wrong. Please try again.'); } finally { setIsSubmitting(false); } }; const handleGoogleSignIn = () => { signInWithGoogle(); }; return (

Sign Up, for free

setName(e.target.value)} required className="w-full px-4 py-3 rounded-lg bg-[#1c1e29] border border-gray-700 text-white focus:outline-none focus:ring-2 focus:ring-purple-500" />
setEmail(e.target.value)} required className="w-full px-4 py-3 rounded-lg bg-[#1c1e29] border border-gray-700 text-white focus:outline-none focus:ring-2 focus:ring-purple-500" />
setPassword(e.target.value)} required className="w-full px-4 py-3 rounded-lg bg-[#1c1e29] border border-gray-700 text-white focus:outline-none focus:ring-2 focus:ring-purple-500" />
{formError && (
{formError}
)}
Back to home
or
{/* Success message */}
Thank you! Your submission has been received!
{/* Error message */}
Oops! Something went wrong while submitting the form.
); }