import React, { useState } from 'react'; import { Link, useNavigate } from 'react-router-dom'; import { Button, Input, Card, Select } from '../../components/ui'; import { PublicLayout } from '../../components/layout'; const RegisterPage: React.FC = () => { const [step, setStep] = useState(1); const [loading, setLoading] = useState(false); const [formData, setFormData] = useState({ // Personal info firstName: '', lastName: '', email: '', phone: '', // Company info companyName: '', companyType: '', employeeCount: '', // Account info password: '', confirmPassword: '', acceptTerms: false, acceptMarketing: false, }); const navigate = useNavigate(); const handleInputChange = (field: string, value: string | boolean) => { setFormData(prev => ({ ...prev, [field]: value })); }; const handleNextStep = () => { setStep(prev => prev + 1); }; const handlePrevStep = () => { setStep(prev => prev - 1); }; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); try { // Simulate API call await new Promise(resolve => setTimeout(resolve, 2000)); // Redirect to onboarding navigate('/onboarding'); } catch (error) { console.error('Registration failed:', error); } finally { setLoading(false); } }; const isStep1Valid = formData.firstName && formData.lastName && formData.email && formData.phone; const isStep2Valid = formData.companyName && formData.companyType && formData.employeeCount; const isStep3Valid = formData.password && formData.confirmPassword && formData.password === formData.confirmPassword && formData.acceptTerms; return (
PI

Crea tu cuenta

O{' '} inicia sesión si ya tienes una cuenta

{/* Progress indicator */}
{[1, 2, 3].map((stepNumber) => (
= stepNumber ? 'bg-[var(--color-primary)] text-white' : 'bg-[var(--bg-quaternary)] text-[var(--text-tertiary)]' }`} > {stepNumber}
{stepNumber < 3 && (
stepNumber ? 'bg-[var(--color-primary)]' : 'bg-[var(--bg-quaternary)]' }`} /> )}
))}
Datos personales Información empresarial Crear cuenta
{step === 1 && ( <>
handleInputChange('firstName', e.target.value)} placeholder="Tu nombre" />
handleInputChange('lastName', e.target.value)} placeholder="Tu apellido" />
handleInputChange('email', e.target.value)} placeholder="tu@email.com" />
handleInputChange('phone', e.target.value)} placeholder="+34 600 000 000" />
)} {step === 2 && ( <>
handleInputChange('companyName', e.target.value)} placeholder="Panadería San Miguel" />
)} {step === 3 && ( <>
handleInputChange('password', e.target.value)} placeholder="Mínimo 8 caracteres" />
handleInputChange('confirmPassword', e.target.value)} placeholder="Repite la contraseña" /> {formData.confirmPassword && formData.password !== formData.confirmPassword && (

Las contraseñas no coinciden

)}
handleInputChange('acceptTerms', e.target.checked)} />
handleInputChange('acceptMarketing', e.target.checked)} />
)}
¿Necesitas ayuda?{' '} Contáctanos
); }; export default RegisterPage;