import { useEffect } from "react"; import { useAuth } from "@/hooks/use-auth"; import { Loader2 } from "lucide-react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; export default function RegisterPage() { const { registerMutation } = useAuth(); const [, setLocation] = useLocation(); const handleRegister = async () => { try { await registerMutation.mutateAsync(); setLocation('/'); // Redirect to home page after successful registration } catch (error) { console.error("Registration failed:", error); } }; return (