import React from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import { LEAD_FORM_OPTIONS } from '../../data/mockStore';
import UrgencyPillSelector from './UrgencyPillSelector';
import LeadCustomSelect from './LeadCustomSelect';
// ---------------------------------------------------------------------------
// Shared field primitives (local to Job section)
// ---------------------------------------------------------------------------
function FieldLabel({ children }) {
return (
{children}
);
}
function LeadTextarea({ label, value, onChange, placeholder, rows = 3 }) {
return (
{label}
);
}
// Shared animation config for collapsing rows
const collapseTransition = {
type: 'spring',
stiffness: 300,
damping: 32,
opacity: { duration: 0.15 },
};
// ---------------------------------------------------------------------------
// Job Details Section
// ---------------------------------------------------------------------------
export default function LeadJobSection({ formData, updateField, isQuickCapture }) {
return (
{/* --- Lead Source — always visible --- */}
updateField('leadSource', v)}
options={LEAD_FORM_OPTIONS.leadSources}
placeholder="How did you find this lead?"
accent="blue"
/>
{/* --- Lead Type — Full Form only --- */}
{!isQuickCapture && (
updateField('leadType', v)}
options={LEAD_FORM_OPTIONS.leadTypes}
placeholder="Residential, Commercial…"
accent="blue"
/>
)}
{/* --- Work Type + Trade Type — Full Form only --- */}
{!isQuickCapture && (
updateField('workType', v)}
options={LEAD_FORM_OPTIONS.workTypes}
placeholder="Roof Replacement, Repair…"
accent="blue"
/>
updateField('tradeType', v)}
options={LEAD_FORM_OPTIONS.tradeTypes}
placeholder="Roofing, Gutter, Siding…"
accent="blue"
/>
)}
{/* --- Urgency — always visible --- */}
Urgency
updateField('urgency', v)}
/>
{/* --- Notes — Full Form only --- */}
{!isQuickCapture && (
updateField('notes', v)}
placeholder="First impression, visible damage, special circumstances…"
rows={3}
/>
)}
);
}