"use client"; import React, { useState } from "react"; import { createUserWithEmailAndPassword } from "firebase/auth"; import { auth } from "@/lib/firebase"; import { useRouter } from "next/navigation"; import { motion } from "framer-motion"; import { Lock, User, ArrowRight, ShieldCheck, Mail, UserPlus } from "lucide-react"; import Link from "next/link"; export default function RegisterPage() { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [name, setName] = useState(""); const [error, setError] = useState(""); const [loading, setLoading] = useState(false); const router = useRouter(); const handleRegister = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); setError(""); try { await createUserWithEmailAndPassword(auth, email, password); router.push("/"); } catch (err: any) { setError(err.message || "Error al crear la cuenta."); setLoading(false); } }; return (
Crea tu cuenta empresarial
¿Ya tienes una cuenta? {" "} Inicia Sesión