import React from 'react'; import { Phone } from 'lucide-react'; import { LEAD_FORM_OPTIONS } from '../../data/mockStore'; import LeadCustomSelect from './LeadCustomSelect'; // --------------------------------------------------------------------------- // Shared field primitives // --------------------------------------------------------------------------- function FieldLabel({ children }) { return ( ); } function LeadInput({ label, value, onChange, placeholder, type = 'text' }) { return (
{label} onChange(e.target.value)} placeholder={placeholder} className="w-full rounded-xl px-4 py-3 text-sm font-medium outline-none transition-all duration-150 bg-white dark:bg-zinc-800/60 border border-zinc-200 dark:border-zinc-700 text-zinc-800 dark:text-white placeholder-zinc-400 dark:placeholder-zinc-500 focus:border-purple-400 dark:focus:border-purple-500 focus:ring-2 focus:ring-purple-100 dark:focus:ring-purple-500/20" />
); } // Phone input with (xxx) xxx-xxxx mask and purple focus ring function AdjusterPhoneInput({ label, value, onChange }) { const handleChange = (e) => { const digits = e.target.value.replace(/\D/g, '').slice(0, 10); let formatted = digits; if (digits.length >= 7) { formatted = `(${digits.slice(0, 3)}) ${digits.slice(3, 6)}-${digits.slice(6)}`; } else if (digits.length >= 4) { formatted = `(${digits.slice(0, 3)}) ${digits.slice(3)}`; } else if (digits.length >= 1) { formatted = `(${digits}`; } onChange(formatted); }; return (
{label}
); } // --------------------------------------------------------------------------- // Insurance Section — Phase 5 (Full Form only) // --------------------------------------------------------------------------- export default function LeadInsuranceSection({ formData, updateField }) { return (
{/* Row 1: Insurance Company (full width) */} updateField('insuranceCompany', v)} options={LEAD_FORM_OPTIONS.insuranceCompanies} placeholder="Select carrier…" accent="purple" /> {/* Row 2: Claim Number + Claim Status */}
updateField('claimNumber', v)} placeholder="e.g. CLM-2026-00482" /> updateField('claimStatus', v)} options={LEAD_FORM_OPTIONS.claimStatuses} placeholder="Select status…" accent="purple" />
{/* Row 3: Adjuster Name + Adjuster Phone */}
updateField('adjusterName', v)} placeholder="Full name" /> updateField('adjusterPhone', v)} />
{/* Row 4: Policy Number (full width) */} updateField('policyNumber', v)} placeholder="e.g. POL-7734892-A" />
); }