import React from 'react'; import { Truck } from 'lucide-react'; import type { WizardStepProps } from '../../../ui/WizardModal/WizardModal'; import type { SupplierCreate, PaymentTerms, DeliverySchedule } from '../../../../api/types/suppliers'; interface SupplierDeliveryStepProps extends WizardStepProps { supplierData: Partial; onUpdate: (data: Partial) => void; } export const SupplierDeliveryStep: React.FC = ({ supplierData, onUpdate, onNext, onBack }) => { const handleFieldChange = (field: keyof SupplierCreate, value: any) => { onUpdate({ ...supplierData, [field]: value }); }; const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); onNext(); }; const isValid = supplierData.payment_terms; return (
{/* Header */}

Entrega y Términos

Define términos de pago, entrega y ubicación

{/* Form Fields */}
{/* Payment Terms & Lead Time */}
handleFieldChange('lead_time_days', e.target.value ? parseInt(e.target.value) : undefined)} placeholder="Ej: 3" min="0" className="w-full px-4 py-2.5 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]" />
{/* Minimum Order & Delivery Schedule */}
handleFieldChange('minimum_order_value', e.target.value ? parseFloat(e.target.value) : undefined)} placeholder="Ej: 100" min="0" step="0.01" className="w-full px-4 py-2.5 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]" />
{/* Address Section */}

Dirección del Proveedor (Opcional)

handleFieldChange('address_street', e.target.value)} placeholder="Ej: Calle Mayor, 123" className="w-full px-4 py-2.5 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]" />
handleFieldChange('address_city', e.target.value)} placeholder="Ej: Madrid" className="w-full px-4 py-2.5 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]" />
handleFieldChange('address_postal_code', e.target.value)} placeholder="Ej: 28001" className="w-full px-4 py-2.5 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]" />
handleFieldChange('address_country', e.target.value)} placeholder="Ej: España" className="w-full px-4 py-2.5 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]" />
{/* Validation Message */} {!isValid && (

⚠️ Campo requerido: Selecciona los términos de pago.

)} {/* Hidden submit button for form handling */}