import React, { useState } from 'react'; import { useNavigate, Link } from 'react-router'; import { BrandLogo } from '../components/common/BrandLogo'; import { FiMail, FiLock, FiUser, FiArrowRight, FiCheckCircle } from 'react-icons/fi'; import { FaGraduationCap, FaChalkboardTeacher } from 'react-icons/fa'; import type { User } from '../types/course'; interface RegisterViewProps { onShowToast: (msg: string) => void; onLogin: (user: User) => void; } export const RegisterView: React.FC = ({ onShowToast, onLogin }) => { const navigate = useNavigate(); const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [accountType, setAccountType] = useState<'buyer' | 'seller'>('buyer'); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); if (name && email && password) { const newUser: User = { id: Math.random().toString(36).substr(2, 9), name, email, role: accountType, }; onLogin(newUser); onShowToast(`¡Cuenta de ${accountType === 'buyer' ? 'Estudiante' : 'Instructor'} creada con éxito!`); navigate(accountType === 'seller' ? '/seller' : '/courses'); } }; return (
{/* Header */}

Crear Cuenta

Únete a la comunidad de RyCourses y empieza hoy mismo

{/* Account type selector */}
{/* Form */}
setName(e.target.value)} placeholder="Carlos Mendoza" className="w-full pl-10 pr-4 py-3 bg-slate-950 border border-slate-700/80 rounded-xl text-xs text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-cyan-500" />
setEmail(e.target.value)} placeholder="ejemplo@correo.com" className="w-full pl-10 pr-4 py-3 bg-slate-950 border border-slate-700/80 rounded-xl text-xs text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-cyan-500" />
setPassword(e.target.value)} placeholder="Mínimo 8 caracteres" className="w-full pl-10 pr-4 py-3 bg-slate-950 border border-slate-700/80 rounded-xl text-xs text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-cyan-500" />
Acepto los términos de servicio y políticas de privacidad.
{/* Footer link */}

¿Ya tienes una cuenta?{' '} Inicia sesión

); };