import React from 'react'; import { Input, Select, Badge } from '../../ui'; import type { OnboardingStepProps } from './OnboardingWizard'; interface CompanyInfo { name: string; type: 'artisan' | 'industrial' | 'chain' | 'mixed'; size: 'small' | 'medium' | 'large'; locations: number; specialties: string[]; address: { street: string; city: string; state: string; postal_code: string; country: string; }; contact: { phone: string; email: string; website?: string; }; established_year?: number; tax_id?: string; } const BAKERY_TYPES = [ { value: 'artisan', label: 'Artesanal', description: 'Producción tradicional y manual' }, { value: 'industrial', label: 'Industrial', description: 'Producción automatizada a gran escala' }, { value: 'chain', label: 'Cadena', description: 'Múltiples ubicaciones con procesos estandarizados' }, { value: 'mixed', label: 'Mixta', description: 'Combinación de métodos artesanales e industriales' }, ]; const BAKERY_SIZES = [ { value: 'small', label: 'Pequeña', description: '1-10 empleados' }, { value: 'medium', label: 'Mediana', description: '11-50 empleados' }, { value: 'large', label: 'Grande', description: '50+ empleados' }, ]; const COMMON_SPECIALTIES = [ 'Pan tradicional', 'Bollería', 'Repostería', 'Pan integral', 'Pasteles', 'Productos sin gluten', 'Productos veganos', 'Pan artesanal', 'Productos de temporada', 'Catering', ]; export const CompanyInfoStep: React.FC = ({ data, onDataChange, }) => { const companyData: CompanyInfo = { name: '', type: 'artisan', size: 'small', locations: 1, specialties: [], address: { street: '', city: '', state: '', postal_code: '', country: 'España', }, contact: { phone: '', email: '', website: '', }, ...data, }; const handleInputChange = (field: string, value: any) => { onDataChange({ ...companyData, [field]: value, }); }; const handleAddressChange = (field: string, value: string) => { onDataChange({ ...companyData, address: { ...companyData.address, [field]: value, }, }); }; const handleContactChange = (field: string, value: string) => { onDataChange({ ...companyData, contact: { ...companyData.contact, [field]: value, }, }); }; const handleSpecialtyToggle = (specialty: string) => { const currentSpecialties = companyData.specialties || []; const updatedSpecialties = currentSpecialties.includes(specialty) ? currentSpecialties.filter(s => s !== specialty) : [...currentSpecialties, specialty]; handleInputChange('specialties', updatedSpecialties); }; return (
{/* Basic Information */}

Información básica

handleInputChange('name', e.target.value)} placeholder="Ej: Panadería San Miguel" className="w-full" />
handleInputChange('locations', parseInt(e.target.value) || 1)} className="w-full" />
handleInputChange('established_year', parseInt(e.target.value) || undefined)} placeholder="Ej: 1995" className="w-full" />
handleInputChange('tax_id', e.target.value)} placeholder="Ej: B12345678" className="w-full" />
{/* Specialties */}

Especialidades

Selecciona los productos que produces habitualmente

{COMMON_SPECIALTIES.map((specialty) => ( ))}
{companyData.specialties && companyData.specialties.length > 0 && (

Especialidades seleccionadas:

{companyData.specialties.map((specialty) => ( {specialty} ))}
)}
{/* Address */}

Dirección principal

handleAddressChange('street', e.target.value)} placeholder="Calle, número, piso, puerta" className="w-full" />
handleAddressChange('city', e.target.value)} placeholder="Ej: Madrid" className="w-full" />
handleAddressChange('state', e.target.value)} placeholder="Ej: Madrid" className="w-full" />
handleAddressChange('postal_code', e.target.value)} placeholder="Ej: 28001" className="w-full" />
{/* Contact Information */}

Información de contacto

handleContactChange('phone', e.target.value)} placeholder="Ej: +34 911 234 567" className="w-full" />
handleContactChange('email', e.target.value)} placeholder="contacto@panaderia.com" className="w-full" />
handleContactChange('website', e.target.value)} placeholder="https://www.panaderia.com" className="w-full" />
{/* Summary */}

Resumen

Panadería: {companyData.name || 'Sin especificar'}

Tipo: {BAKERY_TYPES.find(t => t.value === companyData.type)?.label}

Tamaño: {BAKERY_SIZES.find(s => s.value === companyData.size)?.label}

Especialidades: {companyData.specialties?.length || 0} seleccionadas

Ubicaciones: {companyData.locations}

); }; export default CompanyInfoStep;