import React from 'react'; import { FormSection } from '../../../components/forms/FormSection'; import { FormField } from '../../../components/forms/FormField'; import { SelectField } from '../../../components/forms/SelectField'; const usStates = [ 'AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'FL', 'GA', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY', ]; const caProvinces = ['AB', 'BC', 'MB', 'NB', 'NL', 'NS', 'NT', 'NU', 'ON', 'PE', 'QC', 'SK', 'YT']; const countries = [ { value: 'US', label: 'United States' }, { value: 'CA', label: 'Canada' }, ]; interface BusinessAddressStepProps { data: any; errors: Record; onChange: (data: any) => void; } export function BusinessAddressStep({ data, errors, onChange }: BusinessAddressStepProps) { const regions = data.isoCountry === 'CA' ? caProvinces : usStates; return (
onChange({ customerName: v })} helpText="Name associated with this address" error={errors.customerName} required /> onChange({ street: v })} placeholder="123 Main Street" error={errors.street} required /> onChange({ streetSecondary: v })} placeholder="Suite 100 (optional)" />
onChange({ city: v })} error={errors.city} required /> onChange({ region: v })} options={regions} error={errors.region} required />
onChange({ postalCode: v })} placeholder={data.isoCountry === 'CA' ? 'A1A 1A1' : '12345'} error={errors.postalCode} required /> onChange({ isoCountry: v, region: '' })} options={countries} required />
); }