"use client" import { useState } from "react" import Link from "next/link" import { supabase } from "@/lib/supabase" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card" import { AlertCircle, Loader2, CheckCircle2 } from "lucide-react" export default function SignUpPage() { const [email, setEmail] = useState("") const [password, setPassword] = useState("") const [loading, setLoading] = useState(false) const [error, setError] = useState(null) const [success, setSuccess] = useState(false) const handleSignUp = async (e: React.FormEvent) => { e.preventDefault() setLoading(true) setError(null) try { const { data, error } = await supabase.auth.signUp({ email, password, options: { emailRedirectTo: `${location.origin}/auth/callback`, }, }) if (error) { setError(error.message) return } if (data.user) { setSuccess(true) } } catch { setError("Bir hata oluştu. Lütfen tekrar deneyin.") } finally { setLoading(false) } } if (success) { return (
Başarılı! Kayıt işleminiz başarıyla tamamlandı. Lütfen e-posta adresinizi kontrol ederek hesabınızı doğrulayın.
) } return (
Hesap Oluştur ParaKasa'ya katılmak için bilgilerinizi girin
setEmail(e.target.value)} required />
setPassword(e.target.value)} required minLength={6} />

En az 6 karakter olmalıdır.

{error && (
{error}
)}
Zaten hesabınız var mı?{" "} Giriş Yap
Ana Sayfaya Dön
) }