'use client'; import { useState } from 'react'; import { Link, useRouter } from '@/i18n/routing'; import { authClient } from '@/lib/auth-client'; import { useTranslations } from 'next-intl'; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; export default function SignUp() { const t = useTranslations('Auth'); const [formData, setFormData] = useState({ name: '', email: '', password: '', confirmPassword: '', }); const [isLoading, setIsLoading] = useState(false); const router = useRouter(); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (formData.password !== formData.confirmPassword) { alert(t('passwordMismatch')); return; } setIsLoading(true); await authClient.signUp.email({ email: formData.email, password: formData.password, name: formData.name, }, { onSuccess: () => { router.push('/dashboard'); }, onError: (ctx) => { alert(ctx.error.message); setIsLoading(false); } }); }; const handleChange = (e: React.ChangeEvent) => { setFormData({ ...formData, [e.target.name]: e.target.value, }); }; return (
{/* Logo */}

kreatiVortex

{t('signUpTitle')}

{/* Form */}
{/* Sign in link */}

{t('haveAccount')}{' '} {t('signInNow')}

); }